philomena/priv/repo/migrations/20220321173359_add_approval_queue.exs

36 lines
813 B
Elixir
Raw Normal View History

2022-03-21 19:08:06 +01:00
defmodule Philomena.Repo.Migrations.AddApprovalQueue do
use Ecto.Migration
def change do
alter table("reports") do
add :system, :boolean, default: false
end
alter table("images") do
2022-03-22 22:23:30 +01:00
add :approved, :boolean, default: false
2022-03-21 19:08:06 +01:00
end
alter table("comments") do
2022-03-22 22:23:30 +01:00
add :approved, :boolean, default: false
2022-03-21 19:08:06 +01:00
end
alter table("posts") do
2022-03-22 22:23:30 +01:00
add :approved, :boolean, default: false
2022-03-21 19:08:06 +01:00
end
2022-03-24 17:31:57 +01:00
alter table("messages") do
2022-03-22 22:23:30 +01:00
add :approved, :boolean, default: false
2022-03-21 19:08:06 +01:00
end
alter table("users") do
add :verified, :boolean, default: false
end
2022-03-24 17:31:57 +01:00
create index(:images, [:hidden_from_users, :approved],
where: "hidden_from_users = false and approved = false"
)
create index(:reports, [:system], where: "system = true")
2022-03-21 19:08:06 +01:00
end
end