slightly changed how files are stored in the bucket and allows post deletion

This commit is contained in:
2026-03-31 17:12:40 -04:00
parent 1c1830b086
commit 53467cd611
7 changed files with 295 additions and 3 deletions

View File

@@ -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