-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: edit and delete activity from activity view
- adjusted `activities_assessment_points_activity_id_fkey` constraint to prevent delete cascade assessment points when deleting activities
- Loading branch information
Showing
8 changed files
with
188 additions
and
26 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
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
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
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
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
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
18 changes: 18 additions & 0 deletions
18
...ns/20231201184646_set_activities_assessment_points_activity_id_fkey_on_delete_nothing.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,18 @@ | ||
defmodule Lanttern.Repo.Migrations.SetActivitiesAssessmentPointsActivityIdFkeyOnDeleteNothing do | ||
use Ecto.Migration | ||
|
||
def change do | ||
execute """ | ||
ALTER TABLE activities_assessment_points | ||
DROP CONSTRAINT activities_assessment_points_activity_id_fkey, | ||
ADD CONSTRAINT activities_assessment_points_activity_id_fkey FOREIGN KEY (activity_id) | ||
REFERENCES activities (id); | ||
""", | ||
""" | ||
ALTER TABLE activities_assessment_points | ||
DROP CONSTRAINT activities_assessment_points_activity_id_fkey, | ||
ADD CONSTRAINT activities_assessment_points_activity_id_fkey FOREIGN KEY (activity_id) | ||
REFERENCES activities (id) ON DELETE CASCADE; | ||
""" | ||
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