diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2019-10-26 22:32:31 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2019-10-26 22:32:31 +0300 |
commit | 5cb03fe8010d479e32979d2c02ec8bcf1edf1a67 (patch) | |
tree | 69a78ad300fa7db3e1f36175c0c293dded159428 /priv | |
parent | 07a6f8b8a33a137101dd1ceebc4fb5f5748c055b (diff) | |
download | pleroma-5cb03fe8010d479e32979d2c02ec8bcf1edf1a67.tar.gz |
Add migration
Diffstat (limited to 'priv')
-rw-r--r-- | priv/repo/migrations/20191026190500_set_not_null_for_apps.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/priv/repo/migrations/20191026190500_set_not_null_for_apps.exs b/priv/repo/migrations/20191026190500_set_not_null_for_apps.exs new file mode 100644 index 000000000..a6a44ddfe --- /dev/null +++ b/priv/repo/migrations/20191026190500_set_not_null_for_apps.exs @@ -0,0 +1,17 @@ +defmodule Pleroma.Repo.Migrations.SetNotNullForApps do + use Ecto.Migration + + # modify/3 function will require index recreation, so using execute/1 instead + + def up do + execute("ALTER TABLE apps + ALTER COLUMN client_name SET NOT NULL, + ALTER COLUMN redirect_uris SET NOT NULL") + end + + def down do + execute("ALTER TABLE apps + ALTER COLUMN client_name DROP NOT NULL, + ALTER COLUMN redirect_uris DROP NOT NULL") + end +end |