summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20200831192323_create_backups.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-09-02 20:21:33 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-10-07 18:34:28 +0400
commit4f3a6337454807f4145bbc1830c3d55dd883d46d (patch)
tree5eba3b745e47f6d37f6db4d472fbecfe89da1bb4 /priv/repo/migrations/20200831192323_create_backups.exs
parent75e07ba206b94155c5210151a49e29a11bce6e50 (diff)
downloadpleroma-4f3a6337454807f4145bbc1830c3d55dd883d46d.tar.gz
pleroma-4f3a6337454807f4145bbc1830c3d55dd883d46d.zip
Add `backups` table
Diffstat (limited to 'priv/repo/migrations/20200831192323_create_backups.exs')
-rw-r--r--priv/repo/migrations/20200831192323_create_backups.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200831192323_create_backups.exs b/priv/repo/migrations/20200831192323_create_backups.exs
new file mode 100644
index 000000000..3ac5889e2
--- /dev/null
+++ b/priv/repo/migrations/20200831192323_create_backups.exs
@@ -0,0 +1,17 @@
+defmodule Pleroma.Repo.Migrations.CreateBackups do
+ use Ecto.Migration
+
+ def change do
+ create_if_not_exists table(:backups) do
+ add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
+ add(:file_name, :string, null: false)
+ add(:content_type, :string, null: false)
+ add(:processed, :boolean, null: false, default: false)
+ add(:file_size, :bigint)
+
+ timestamps()
+ end
+
+ create_if_not_exists(index(:backups, [:user_id]))
+ end
+end