mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-23 00:14:48 +00:00
Merge branch 'remove-events-when-deleting-organizer' into 'master'
Remove events when deleting organizer See merge request framasoft/mobilizon!172
This commit is contained in:
commit
57f839c17a
1 changed files with 19 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
||||||
|
defmodule Mobilizon.Repo.Migrations.RemoveEventsWhenDeletingOrganizer do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def up do
|
||||||
|
drop(constraint(:events, "events_organizer_account_id_fkey"))
|
||||||
|
|
||||||
|
alter table(:events) do
|
||||||
|
modify(:organizer_actor_id, references(:actors, on_delete: :delete_all))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down do
|
||||||
|
drop(constraint(:events, "events_organizer_actor_id_fkey"))
|
||||||
|
|
||||||
|
alter table(:events) do
|
||||||
|
modify(:organizer_actor_id, references(:actors, on_delete: :nothing))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue