pointers v0.1.0 Pointers.Migration View Source

Migration helpers for creating tables that participate in the pointers abasction.

Link to this section Summary

Functions

Adds a pointer primary key to the table. Not required if you are using create_pointable_table

Creates a pointable table along with its trigger.

Creates a trait table - one with a ULID primary key and no trigger

Drops a pointable table

Drops a trait table. Actually just drop_if_exists table(name)

When migrating up: initialises the pointers database. When migrating down: deinitialises the pointers database.

Given :up: initialises the pointers database. Given :down: deinitialises the pointers database.

Link to this section Functions

Specs

add_pointer_pk() :: nil

Adds a pointer primary key to the table. Not required if you are using create_pointable_table

Specs

add_pointer_ref_pk() :: nil
Link to this macro

create_pointable_table(name, id, opts \\ [], body)

View Source (macro)

Specs

create_pointable_table(
  name :: binary(),
  id :: binary(),
  opts :: Keyword.t(),
  body :: term()
) :: term()

Creates a pointable table along with its trigger.

Link to this macro

create_trait_table(name, opts \\ [], body)

View Source (macro)

Creates a trait table - one with a ULID primary key and no trigger

Link to this function

drop_pointable_table(name)

View Source

Specs

drop_pointable_table(name :: binary()) :: nil

Drops a pointable table

Specs

drop_trait_table(name :: binary()) :: nil

Drops a trait table. Actually just drop_if_exists table(name)

Specs

init_pointers() :: nil

When migrating up: initialises the pointers database. When migrating down: deinitialises the pointers database.

Specs

init_pointers(direction :: :up | :down) :: nil

Given :up: initialises the pointers database. Given :down: deinitialises the pointers database.

Link to this function

init_pointers_ulid_extra()

View Source

See Pointers.ULID.Migration.init_pointers_ulid_extra/0.