Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
603B

  1. defmodule Pleroma.Repo.Migrations.CreateFilters do
  2. use Ecto.Migration
  3. def change do
  4. create_if_not_exists table(:filters) do
  5. add(:user_id, references(:users, on_delete: :delete_all))
  6. add(:filter_id, :integer)
  7. add(:hide, :boolean)
  8. add(:phrase, :string)
  9. add(:context, {:array, :string})
  10. add(:expires_at, :utc_datetime)
  11. add(:whole_word, :boolean)
  12. timestamps()
  13. end
  14. create_if_not_exists(index(:filters, [:user_id]))
  15. create_if_not_exists(
  16. index(:filters, [:phrase], where: "hide = true", name: :hided_phrases_index)
  17. )
  18. end
  19. end