mix cardbox.gen.migration (Cardbox v0.1.0)

Copy Markdown View Source

Writes the migration that takes Cardbox's tables to their latest version (Cardbox.Migrations).

$ mix cardbox.gen.migration
$ mix cardbox.gen.migration --migrations-path priv/other_repo/migrations

Then run mix ecto.migrate.

The first time, the migration makes the tables:

def up, do: Cardbox.Migrations.up(version: 1)
def down, do: Cardbox.Migrations.down(to: 0)

After an upgrade of Cardbox whose tables have a new version, it writes the migration from the version your migrations pin, read from their files (so it needs no database), to the new one. When they pin the latest already, it writes nothing.

Options

  • --migrations-path - where the migrations are, priv/repo/migrations unless given.