DynamoMigration (DynamoMigration v0.1.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 # Generates migration file.
    defmodule Dynamo.Migrations.CreateTestsTable do
    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.

Returns true if migration version does not exists in migrations table.

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

migration_file_path()

Specs

migration_file_path() :: String.t()
Link to this function

migration_required?(version)

Specs

migration_required?(integer()) :: boolean()

Returns true if migration version does not exists in migrations table.

Specs

setup() :: :ok

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