ash_postgres/priv/test_repo/tenant_migrations/20210127001300_migrate_resources1.exs

29 lines
772 B
Elixir
Raw Normal View History

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