ash_postgres/priv/test_repo/tenant_migrations/20210127001300_migrate_resources1.exs
Zach Daniel fbc42ce87a fix: rework the way multitenant migrations work
feat: add `mix ash_postgres.create`

feat: add `mix ash_postgres.migrate`

feat: add `mix ash_postgres.migrate --tenants`

feat: add `mix ash_postgres.drop`
2021-01-26 19:16:29 -05:00

29 lines
No EOL
772 B
Elixir

defmodule AshPostgres.TestRepo.TenantMigrations.MigrateResources1 do
@moduledoc """
Updates resources based on their most recent snapshots.
This file was autogenerated with `mix ash_postgres.generate_migrations`
"""
use Ecto.Migration
def up do
create table(:multitenant_posts, primary_key: false, prefix: prefix()) do
add :id, :binary_id, null: false, default: fragment("uuid_generate_v4()"), primary_key: true
add :org_id,
references("multitenant_orgs",
type: :binary_id,
column: :id,
name: "#{prefix()}_multitenant_orgs_org_id_fkey",
prefix: "public"
)
add :name, :text
end
end
def down do
drop table("multitenant_posts", prefix: prefix())
end
end