philomena/priv/repo/migrations/20210121200815_add_ban_duration_constraints.exs

18 lines
529 B
Elixir
Raw Normal View History

2021-01-21 21:24:22 +01:00
defmodule Philomena.Repo.Migrations.AddBanDurationConstraints do
use Ecto.Migration
def change do
2021-02-09 23:14:44 +01:00
create constraint("user_bans", "user_ban_duration_must_be_valid",
check: "valid_until < '4000-01-01'"
)
create constraint("subnet_bans", "subnet_ban_duration_must_be_valid",
check: "valid_until < '4000-01-01'"
)
create constraint("fingerprint_bans", "fingerprint_ban_duration_must_be_valid",
check: "valid_until < '4000-01-01'"
)
2021-01-21 21:24:22 +01:00
end
end