ash_postgres/priv/test_repo/tenant_migrations/20240610162043_migrate_resources3.exs

45 lines
1 KiB
Elixir

defmodule AshPostgres.TestRepo.TenantMigrations.MigrateResources3 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(:friend_links, primary_key: false, prefix: prefix()) do
add(
:source_id,
references(:multitenant_posts,
column: :id,
name: "friend_links_source_id_fkey",
type: :uuid,
prefix: prefix()
),
primary_key: true,
null: false
)
add(
:dest_id,
references(:multitenant_posts,
column: :id,
name: "friend_links_dest_id_fkey",
type: :uuid,
prefix: prefix()
),
primary_key: true,
null: false
)
end
end
def down do
drop(constraint(:friend_links, "friend_links_source_id_fkey"))
drop(constraint(:friend_links, "friend_links_dest_id_fkey"))
drop(table(:friend_links, prefix: prefix()))
end
end