logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

20180813003722_create_filters.exs (762B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.CreateFilters do
  5. use Ecto.Migration
  6. def change do
  7. create_if_not_exists table(:filters) do
  8. add(:user_id, references(:users, on_delete: :delete_all))
  9. add(:filter_id, :integer)
  10. add(:hide, :boolean)
  11. add(:phrase, :string)
  12. add(:context, {:array, :string})
  13. add(:expires_at, :utc_datetime)
  14. add(:whole_word, :boolean)
  15. timestamps()
  16. end
  17. create_if_not_exists(index(:filters, [:user_id]))
  18. create_if_not_exists(
  19. index(:filters, [:phrase], where: "hide = true", name: :hided_phrases_index)
  20. )
  21. end
  22. end