CampaignFlow.MockServer.Migrations (CampaignFlow Client v2.2.0)
View SourceMigrations for the mock server PostgreSQL tables.
Usage
Generate a migration in your application:
mix ecto.gen.migration add_campaign_flow_mock_serverThen call the migration functions:
defmodule MyApp.Repo.Migrations.AddCampaignFlowMockServer do
use Ecto.Migration
def up, do: CampaignFlow.MockServer.Migrations.up(version: 1)
def down, do: CampaignFlow.MockServer.Migrations.down(version: 1)
endSchema reset
This migration is for a mock/dev/test server. When the definition changes
(as it did when integer IDs replaced UUIDs and the campaign schema was
expanded to match the OpenAPI Campaign shape), existing dev/test
databases must be dropped and recreated — there is no incremental
upgrade path. For the bundled test repo:
MIX_ENV=test mix ecto.drop --repo CampaignFlow.TestRepo
MIX_ENV=test mix ecto.create --repo CampaignFlow.TestRepoSummary
Functions
Returns the current migration version.
Runs the down migrations from the specified version.
Runs the up migrations up to the specified version.