Merge branch 'add-secure-and-samesite-cookie-flags' into 'develop'
[akkoma] / priv / repo / migrations / 20180813003722_create_filters.exs
1 defmodule Pleroma.Repo.Migrations.CreateFilters do
2 use Ecto.Migration
3
4 def change do
5 create table(:filters) do
6 add :user_id, references(:users, on_delete: :delete_all)
7 add :filter_id, :integer
8 add :hide, :boolean
9 add :phrase, :string
10 add :context, {:array, :string}
11 add :expires_at, :datetime
12 add :whole_word, :boolean
13
14 timestamps()
15 end
16
17 create index(:filters, [:user_id])
18 create index(:filters, [:phrase], where: "hide = true", name: :hided_phrases_index)
19 end
20 end