diff --git a/priv/repo/migrations/20201125170429_create_media.exs b/priv/repo/migrations/20201125170429_create_media.exs index a1bd125c3..ce0dbffe7 100644 --- a/priv/repo/migrations/20201125170429_create_media.exs +++ b/priv/repo/migrations/20201125170429_create_media.exs @@ -3,15 +3,15 @@ defmodule Pleroma.Repo.Migrations.CreateMedia do def change do create_if_not_exists table(:media) do + add(:actor, :string) add(:href, :string, null: false) add(:type, :string, null: false) add(:media_type, :string, null: false) add(:name, :string) add(:blurhash, :string) add(:meta, :map) - # TODO discuss delete_all option - add(:object_id, references(:objects, on_delete: :nothing), null: true) - add(:user_id, references(:users, type: :uuid, on_delete: :nothing), null: false) + + add(:object_id, references(:objects, on_delete: :delete_all), null: true) timestamps() end