Ecto.Adapters.Mnesia.Migration (Ecto3 Mnesia v0.3.0) View Source
Functions for dealing with schema migrations
Link to this section Summary
Functions
Creates mnesia table.
Drop table
Returns true if table is stored in RAM
Add a foreign key constraint
Creates table and wait for its creation
Link to this section Types
Specs
access_opt() :: {:access_mode, :read_write | :read_only}
Specs
create_opt() :: access_opt() | disc_copies_opt() | disc_only_copies_opt() | index_opt() | load_order_opt() | majority_opt() | ram_copies_opt() | storage_properties_opt() | local_content_opt()
Specs
create_opts() :: [create_opt()]
Specs
disc_copies_opt() :: {:disc_copies, [node()]}
Specs
disc_only_copies_opt() :: {:disc_only_copies, [node()]}
Specs
index_opt() :: {:index, [atom()]}
Specs
load_order_opt() :: {:load_order, integer()}
Specs
local_content_opt() :: {:local_content, boolean()}
Specs
majority_opt() :: {:majority, boolean()}
Specs
ram_copies_opt() :: {:ram_copies, [node()]}
Specs
Specs
sync_create_opts() :: [{:timeout, integer()} | create_opts()]
Specs
Specs
table() :: atom()
Link to this section Functions
Specs
create_table(module(), module(), create_opts()) :: {:ok, table()} | :ignore | {:error, term()}
Creates mnesia table.
See http://erlang.org/doc/man/mnesia.html#create_table-2
for options, except
from the following ones:
attributes
: ignored, computed from schemaindex
: in addition to primary keys indicesrecord_name
: ignored, computed from schemasnmp
: unsupportedtype
: ignored, all tables are of typeset
Returns created table name
Specs
Drop table
Returns ok if table has been deleted or did not exist
Returns true if table is stored in RAM
Specs
references(module(), atom(), Ecto.Adapters.Mnesia.Constraint.ForeignKey.opts()) :: :ok | {:error, term()}
Add a foreign key constraint
Specs
sync_create_table(module(), module(), sync_create_opts()) :: :ok | {:error, term()}
Creates table and wait for its creation