Rivet.Migration (rivet v2.7.1)
View SourceSummary
Types
@type rivet_migration_input_any() :: rivet_migration_input_include() | rivet_migration_input_external() | rivet_migration_input_model()
@type rivet_migration_input_external() :: %{ external: String.t(), migrations: [rivet_migration_input_include()] }
@type rivet_migration_input_model() :: map()
@type rivet_migrations() :: [t()]
@type rivet_state_result() :: {:ok, rivet_migration_state()} | rivet_error()
Functions
iex> datestamp(~N[2023-05-31 08:11:59])
"20230531081159"
iex> String.length(datestamp()) == 20
@spec load_data_file(String.t()) :: {:ok, [list()]} | rivet_error()
iex> load_data_file("nar")
{:error, "Cannot find file 'nar'"}
iex> load_data_file("test/support/rivet_test_input")
{:error, "Cannot load file 'test/support/rivet_test_input': Invalid contents"}
# force an error
iex> load_data_file("LICENSE.txt")
{:error, "Cannot load file 'LICENSE.txt': keyword argument must be followed by space after: http:"}
iex> maxlen_in(["a", "bcde", "fgh", "xyzabcdef"])
9
iex> migration_model(This.Narf.Migrations)
"Narf"
iex> migration_model(This.Narf.Not)
"Not"
iex> module_extend(This.Module, Narf)
This.Module.Narf
iex> module_pop(This.Module.Narf)
This.Module
iex> nodot("this/narf/not.ex")
["this", "narf", "not.ex"]
iex> nodot("./narf/not.ex")
["narf", "not.ex"]
iex> pad("x", 4)
"000x"
iex> pad("4", -4)
"4000"
iex> pad(4, -4)
"4000"
iex> pad(4, 4)
"0004"