kura_schema_diff (rebar3_kura v0.13.1)
View SourceSummary
Types
-type alter_op() :: {add_column, #kura_column{name :: atom(), type :: kura_types:kura_type(), nullable :: boolean(), default :: term(), primary_key :: boolean(), references :: {binary(), atom()} | undefined, on_delete :: cascade | restrict | set_null | no_action | undefined, on_update :: cascade | restrict | set_null | no_action | undefined}} | {drop_column, atom()} | {rename_column, atom(), atom()} | {modify_column, atom(), kura_types:kura_type()}.
-type col_state() :: #{binary() => [#kura_column{name :: atom(), type :: kura_types:kura_type(), nullable :: boolean(), default :: term(), primary_key :: boolean(), references :: {binary(), atom()} | undefined, on_delete :: cascade | restrict | set_null | no_action | undefined, on_update :: cascade | restrict | set_null | no_action | undefined}]}.
-type db_state() :: #{columns => col_state(), indexes => index_state()}.
-type index_state() :: #{binary() => [index_entry()]}.
-type operation() :: {create_table, binary(), [#kura_column{name :: atom(), type :: kura_types:kura_type(), nullable :: boolean(), default :: term(), primary_key :: boolean(), references :: {binary(), atom()} | undefined, on_delete :: cascade | restrict | set_null | no_action | undefined, on_update :: cascade | restrict | set_null | no_action | undefined}]} | {drop_table, binary()} | {alter_table, binary(), [alter_op()]} | {create_index, binary(), [atom()], map()} | {drop_index, binary()} | {execute, binary()}.
Functions
-spec field_to_column(#kura_field{name :: atom(), type :: kura_types:kura_type(), column :: binary() | undefined, default :: term(), primary_key :: boolean(), nullable :: boolean(), virtual :: boolean()}) -> #kura_column{name :: atom(), type :: kura_types:kura_type(), nullable :: boolean(), default :: term(), primary_key :: boolean(), references :: {binary(), atom()} | undefined, on_delete :: cascade | restrict | set_null | no_action | undefined, on_update :: cascade | restrict | set_null | no_action | undefined}.