diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2019-10-26 22:56:48 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2019-10-26 22:56:48 +0300 |
commit | 2e608f7cbf46a02004982ddc48e5b0902869b401 (patch) | |
tree | 6f72266f153a4335fcf0abd7df51cfaeb8b8a953 | |
parent | 07a6f8b8a33a137101dd1ceebc4fb5f5748c055b (diff) | |
download | pleroma-2e608f7cbf46a02004982ddc48e5b0902869b401.tar.gz |
Add migration
-rw-r--r-- | priv/repo/migrations/20191026191711_set_not_null_for_scheduled_activities.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/priv/repo/migrations/20191026191711_set_not_null_for_scheduled_activities.exs b/priv/repo/migrations/20191026191711_set_not_null_for_scheduled_activities.exs new file mode 100644 index 000000000..f1830c8c3 --- /dev/null +++ b/priv/repo/migrations/20191026191711_set_not_null_for_scheduled_activities.exs @@ -0,0 +1,15 @@ +defmodule Pleroma.Repo.Migrations.SetNotNullForScheduledActivities do + use Ecto.Migration + + # modify/3 function will require index recreation, so using execute/1 instead + + def up do + execute("ALTER TABLE scheduled_activities + ALTER COLUMN user_id SET NOT NULL") + end + + def down do + execute("ALTER TABLE scheduled_activities + ALTER COLUMN user_id DROP NOT NULL") + end +end |