Skip to content

Commit

Permalink
Remove fk constraints from return_value.timetable_version
Browse files Browse the repository at this point in the history
These return_value schema tables are only for function return values, and they should not
be part of the data model via any constraints.
  • Loading branch information
HenrikHartiala committed Aug 23, 2023
1 parent a24e226 commit c4db0f7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALTER TABLE return_value.timetable_version
ADD CONSTRAINT timetable_version_vehicle_schedule_frame_id_fkey
FOREIGN KEY (vehicle_schedule_frame_id) REFERENCES vehicle_schedule.vehicle_schedule_frame(vehicle_schedule_frame_id);

ALTER TABLE return_value.timetable_version
ADD CONSTRAINT timetable_version_substitute_operating_day_by_line_type_id_fkey
FOREIGN KEY (substitute_operating_day_by_line_type_id) REFERENCES service_calendar.substitute_operating_day_by_line_type(substitute_operating_day_by_line_type_id);

ALTER TABLE return_value.timetable_version
ADD CONSTRAINT timetable_version_day_type_id_fkey
FOREIGN KEY (day_type_id) REFERENCES service_calendar.day_type(day_type_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ALTER TABLE return_value.timetable_version
DROP CONSTRAINT timetable_version_day_type_id_fkey;

ALTER TABLE return_value.timetable_version
DROP CONSTRAINT timetable_version_substitute_operating_day_by_line_type_id_fkey;

ALTER TABLE return_value.timetable_version
DROP CONSTRAINT timetable_version_vehicle_schedule_frame_id_fkey;

0 comments on commit c4db0f7

Please sign in to comment.