Migrations for PhoenixFlags.
Usage
Generate a migration in your app:
mix ecto.gen.migration add_system_flagsThen call the migration helpers:
defmodule MyApp.Repo.Migrations.AddSystemFlags do
use Ecto.Migration
def up, do: PhoenixFlags.Migration.up()
def down, do: PhoenixFlags.Migration.down(version: 1)
endWhen the package releases a new version with schema changes, generate another migration and specify the target version:
defmodule MyApp.Repo.Migrations.UpgradeSystemFlagsToV2 do
use Ecto.Migration
def up, do: PhoenixFlags.Migration.up(version: 2)
def down, do: PhoenixFlags.Migration.down(version: 2)
endOptions
:version— target version to migrate to (default: latest):prefix— PostgreSQL schema prefix (default:"public")
Summary
Functions
Rolls back migrations to the specified version (or removes everything).
Returns the current migrated version.
Runs migrations up to the specified version (or the latest).
Functions
Rolls back migrations to the specified version (or removes everything).
Returns the current migrated version.
Reads the system_flags_meta table (V3+), falling back to the
system_flags table comment used by older versions. Returns 0 if the
tables don't exist or no version is recorded.
Runs migrations up to the specified version (or the latest).