DynamoMigration (DynamoMigration v0.2.0)
Version management module for migration file of DynamoDB. Dependes on ExAws and ExAws.Dynamo. See also https://github.com/ex-aws/ex_aws_dynamo. Usage:
- $ mix dynamo.setup # Creates migrations table.
- $ mix dynamo.gen.migration create_tests_table --table Tests # Generates migration file.
defmodule Dynamo.Migrations.CreateTestsTable do @table_name "Tests"
def table_name, do: @table_name
def change do
# Rewrite any migration code.
ExAws.Dynamo.create_table(
"Tests",
[id: :hash],
%{id: :number},
1,
1,
:provisioned
)
|> ExAws.request!()
end
end
3. $ mix dynamo.migrate # Migrates `priv/dynamo/migrations/*`.
Link to this section Summary
Functions
Called from mix dynamo.migrate
Executes migration files if there had not migrated.
Reset table migrations.
Creates migrations table for version management.
Called from mix dynamo.setup
Link to this section Functions
Link to this function
migrate()
Specs
migrate() :: :ok
Called from mix dynamo.migrate
Executes migration files if there had not migrated.
Link to this function
reset(only_prefix \\ nil)
Reset table migrations.
Link to this function
setup()
Specs
setup() :: :ok
Creates migrations table for version management.
Called from mix dynamo.setup