Migration: cascade delete enterprise plans on user removal (#4684)

This commit is contained in:
hq1 2024-10-16 10:43:16 +02:00 committed by GitHub
parent 69949e9a16
commit 67e35fa1d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,11 @@
defmodule Plausible.Repo.Migrations.CascadeDeleteEnterprisePlans do
use Ecto.Migration
def change do
drop(constraint(:enterprise_plans, "enterprise_plans_user_id_fkey"))
alter table(:enterprise_plans) do
modify(:user_id, references(:users, on_delete: :delete_all), null: false)
end
end
end