ash_hq/priv/repo/migrations/20230207124153_migrate_resources48.exs

104 lines
2.5 KiB
Elixir
Raw Permalink Normal View History

defmodule AshHq.Repo.Migrations.MigrateResources48 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
2023-02-08 02:05:13 +13:00
drop(constraint(:discord_reactions, "discord_reactions_message_id_fkey"))
alter table(:discord_reactions) do
2023-02-08 02:05:13 +13:00
modify(
:message_id,
references(:discord_messages,
column: :id,
prefix: "public",
name: "discord_reactions_message_id_fkey",
type: :bigint,
on_delete: :delete_all,
on_update: :update_all
)
)
end
2023-02-08 02:05:13 +13:00
drop(constraint(:discord_messages, "discord_messages_thread_id_fkey"))
alter table(:discord_messages) do
2023-02-08 02:05:13 +13:00
modify(
:thread_id,
references(:discord_threads,
column: :id,
prefix: "public",
name: "discord_messages_thread_id_fkey",
type: :bigint,
on_delete: :delete_all,
on_update: :update_all
)
)
end
2023-02-08 02:05:13 +13:00
drop(constraint(:discord_attachments, "discord_attachments_message_id_fkey"))
alter table(:discord_attachments) do
2023-02-08 02:05:13 +13:00
modify(
:message_id,
references(:discord_messages,
column: :id,
prefix: "public",
name: "discord_attachments_message_id_fkey",
type: :bigint,
on_delete: :delete_all,
on_update: :update_all
)
)
end
end
def down do
2023-02-08 02:05:13 +13:00
drop(constraint(:discord_attachments, "discord_attachments_message_id_fkey"))
alter table(:discord_attachments) do
2023-02-08 02:05:13 +13:00
modify(
:message_id,
references(:discord_messages,
column: :id,
prefix: "public",
name: "discord_attachments_message_id_fkey",
type: :bigint
)
)
end
2023-02-08 02:05:13 +13:00
drop(constraint(:discord_messages, "discord_messages_thread_id_fkey"))
alter table(:discord_messages) do
2023-02-08 02:05:13 +13:00
modify(
:thread_id,
references(:discord_threads,
column: :id,
prefix: "public",
name: "discord_messages_thread_id_fkey",
type: :bigint
)
)
end
2023-02-08 02:05:13 +13:00
drop(constraint(:discord_reactions, "discord_reactions_message_id_fkey"))
alter table(:discord_reactions) do
2023-02-08 02:05:13 +13:00
modify(
:message_id,
references(:discord_messages,
column: :id,
prefix: "public",
name: "discord_reactions_message_id_fkey",
type: :bigint
)
)
end
end
2023-02-08 02:05:13 +13:00
end