Merge branch 'refactor/following-relationships' into 'develop'
[akkoma] / priv / repo / migrations / 20191026190841_set_not_null_for_filters.exs
1 defmodule Pleroma.Repo.Migrations.SetNotNullForFilters do
2 use Ecto.Migration
3
4 # modify/3 function will require index recreation, so using execute/1 instead
5
6 def up do
7 execute("ALTER TABLE filters
8 ALTER COLUMN user_id SET NOT NULL,
9 ALTER COLUMN filter_id SET NOT NULL,
10 ALTER COLUMN whole_word SET NOT NULL")
11 end
12
13 def down do
14 execute("ALTER TABLE filters
15 ALTER COLUMN user_id DROP NOT NULL,
16 ALTER COLUMN filter_id DROP NOT NULL,
17 ALTER COLUMN whole_word DROP NOT NULL")
18 end
19 end