ash_postgres/priv/test_repo/migrations/20240516205244_migrate_resources23.exs

31 lines
819 B
Elixir
Raw Normal View History

defmodule AshPostgres.TestRepo.Migrations.MigrateResources23 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
drop(constraint("post_followers", "post_followers_pkey"))
alter table(:post_followers) do
modify(:follower_id, :uuid, primary_key: true)
modify(:post_id, :uuid, primary_key: true)
remove(:id)
end
end
def down do
drop(constraint("post_followers", "post_followers_pkey"))
alter table(:post_followers) do
add(:id, :uuid, null: false, default: fragment("gen_random_uuid()"), primary_key: true)
modify(:post_id, :uuid, primary_key: false)
modify(:follower_id, :uuid, primary_key: false)
end
end
end