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:

  1. $ mix dynamo.setup # Creates migrations table.
  2. $ 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

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.

Specs

setup() :: :ok

Creates migrations table for version management. Called from mix dynamo.setup