mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 03:04:43 +03:00
Allow site deletion with IP Rules stored (#3804)
* Allow site deletion with IP Rules stored * drop_if_exists
This commit is contained in:
parent
5cdca6f408
commit
23b9032148
@ -0,0 +1,19 @@
|
||||
defmodule Plausible.Repo.Migrations.CascadeDeleteIpRules do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
drop_if_exists constraint(:shield_rules_ip, "shield_rules_ip_site_id_fkey")
|
||||
|
||||
alter table(:shield_rules_ip) do
|
||||
modify :site_id, references(:sites, on_delete: :delete_all), null: false
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
drop_if_exists constraint(:shield_rules_ip, "shield_rules_ip_site_id_fkey")
|
||||
|
||||
alter table(:shield_rules_ip) do
|
||||
modify :site_id, references(:sites), null: false
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user