mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-21 05:53:18 +12:00
46 lines
1 KiB
Elixir
46 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
|