pleroma/priv/repo/migrations/20201125170429_create_media.exs

20 lines
572 B
Elixir
Raw Normal View History

2020-12-07 14:37:56 -05:00
defmodule Pleroma.Repo.Migrations.CreateMedia do
use Ecto.Migration
def change do
create_if_not_exists table(:media) do
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)
timestamps()
end
end
end