-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajuste clés étrangères pour resource_related (#3713)
- Loading branch information
1 parent
f3a8f5c
commit c471d43
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
apps/transport/priv/repo/migrations/20240110085755_resource_related_on_delete.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule DB.Repo.Migrations.ResourceRelatedOnDelete do | ||
use Ecto.Migration | ||
|
||
def change do | ||
# Review foreign key settings previously set in | ||
# 20230404074406_add_resource_related.exs | ||
alter table(:resource_related) do | ||
modify(:resource_src_id, references(:resource, on_delete: :delete_all), | ||
from: references(:resource, on_delete: :nothing) | ||
) | ||
|
||
modify(:resource_dst_id, references(:resource, on_delete: :delete_all), | ||
from: references(:resource, on_delete: :nothing) | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters