31 lines
671 B
Elixir
31 lines
671 B
Elixir
defmodule Mixer.Repo.Migrations.AddTweetComments 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(:tweets) do
|
|
add :parent_tweet_id,
|
|
references(:tweets,
|
|
column: :id,
|
|
name: "tweets_parent_tweet_id_fkey",
|
|
type: :uuid,
|
|
prefix: "public",
|
|
on_delete: :delete_all
|
|
)
|
|
end
|
|
end
|
|
|
|
def down do
|
|
drop constraint(:tweets, "tweets_parent_tweet_id_fkey")
|
|
|
|
alter table(:tweets) do
|
|
remove :parent_tweet_id
|
|
end
|
|
end
|
|
end
|