aboutsummaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2020-12-07 22:37:56 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2020-12-07 22:37:56 +0300
commit193c17cea519f5b12f13122fc6d612e1d9f30e62 (patch)
treef091622c80624626b18c70d3f512e9fbaf20f3c8 /priv
parentb3ee618e0d726452248c6fa9a1830d2525b9693b (diff)
downloadpleroma-193c17cea519f5b12f13122fc6d612e1d9f30e62.tar.gz
wip
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20201125170429_create_media.exs19
1 files changed, 19 insertions, 0 deletions
diff --git a/priv/repo/migrations/20201125170429_create_media.exs b/priv/repo/migrations/20201125170429_create_media.exs
new file mode 100644
index 000000000..a1bd125c3
--- /dev/null
+++ b/priv/repo/migrations/20201125170429_create_media.exs
@@ -0,0 +1,19 @@
+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