diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-09-02 20:21:33 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-10-07 18:34:28 +0400 |
commit | 4f3a6337454807f4145bbc1830c3d55dd883d46d (patch) | |
tree | 5eba3b745e47f6d37f6db4d472fbecfe89da1bb4 /priv/repo/migrations/20200831192323_create_backups.exs | |
parent | 75e07ba206b94155c5210151a49e29a11bce6e50 (diff) | |
download | pleroma-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.exs | 17 |
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 |