mirror of
https://github.com/ash-project/ash_postgres.git
synced 2024-09-20 05:23:18 +12:00
4d2d29d976
feat: support configuring polymorphic references feat: support `distinct` Ash queries
37 lines
No EOL
974 B
Elixir
37 lines
No EOL
974 B
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
|
|
alter table(:multitenant_posts, prefix: prefix()) do
|
|
modify :id, :uuid, default: fragment("uuid_generate_v4()")
|
|
|
|
modify :org_id,
|
|
references(:multitenant_orgs,
|
|
type: :uuid,
|
|
column: :id,
|
|
prefix: "public",
|
|
name: "multitenant_posts_org_id_fkey"
|
|
)
|
|
end
|
|
end
|
|
|
|
def down do
|
|
alter table(:multitenant_posts, prefix: prefix()) do
|
|
modify :org_id,
|
|
references(:multitenant_orgs,
|
|
type: :binary_id,
|
|
column: :id,
|
|
prefix: "public",
|
|
name: "multitenant_posts_org_id"
|
|
)
|
|
|
|
modify :id, :binary_id, default: nil
|
|
end
|
|
end
|
|
end |