slightly changed how files are stored in the bucket and allows post deletion
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
defmodule Mixer.Repo.Migrations.CascadeDeleteTweetRelations 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(:tweet_likes, "tweet_likes_tweet_id_fkey")
|
||||
|
||||
alter table(:tweet_likes) do
|
||||
modify :tweet_id,
|
||||
references(:tweets,
|
||||
column: :id,
|
||||
name: "tweet_likes_tweet_id_fkey",
|
||||
type: :uuid,
|
||||
prefix: "public",
|
||||
on_delete: :delete_all
|
||||
)
|
||||
end
|
||||
|
||||
drop constraint(:media, "media_tweet_id_fkey")
|
||||
|
||||
alter table(:media) do
|
||||
modify :tweet_id,
|
||||
references(:tweets,
|
||||
column: :id,
|
||||
name: "media_tweet_id_fkey",
|
||||
type: :uuid,
|
||||
prefix: "public",
|
||||
on_delete: :delete_all
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
drop constraint(:media, "media_tweet_id_fkey")
|
||||
|
||||
alter table(:media) do
|
||||
modify :tweet_id,
|
||||
references(:tweets,
|
||||
column: :id,
|
||||
name: "media_tweet_id_fkey",
|
||||
type: :uuid,
|
||||
prefix: "public"
|
||||
)
|
||||
end
|
||||
|
||||
drop constraint(:tweet_likes, "tweet_likes_tweet_id_fkey")
|
||||
|
||||
alter table(:tweet_likes) do
|
||||
modify :tweet_id,
|
||||
references(:tweets,
|
||||
column: :id,
|
||||
name: "tweet_likes_tweet_id_fkey",
|
||||
type: :uuid,
|
||||
prefix: "public"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user