pointers v0.2.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
Specs
create_pointable_table( name :: binary(), id :: binary(), opts :: Keyword.t(), body :: term() ) :: term()
Creates a pointable table along with its trigger.
Creates a trait table - one with a ULID primary key and no trigger
Specs
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.