-
Notifications
You must be signed in to change notification settings - Fork 0
Add numeric id fields #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
culka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 3 unresolved discussions (waiting on @Leitsi)
migrations/hsl/default/1680267332835_add-scheduled-stop-point-numeric-id/up.sql line 10 at r2 (raw file):
-- Reset the sequence, so first id will be 7000001. SELECT setval('service_pattern.scheduled_stop_point_numeric_id_seq', 7000000);
This sounds potentially very bad.
Luckily we can currently ignore pre-existing values.
migrations/hsl/default/2000000001002_R_after_migrate_scheduled_stop_point/up.sql line 2 at r2 (raw file):
ALTER TABLE service_pattern.scheduled_stop_point ADD CONSTRAINT service_pattern_scheduled_stop_point_numeric_id_range_check CHECK (1 <= numeric_id AND numeric_id <= 9999999);
I like BETWEEN. But it does the same thing.
scripts/specific-schema.sh line 1 at r2 (raw file):
#!/usr/bin/env bash
This file probably should not be included
516192a to
5d16539
Compare
Leitsi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @culka)
migrations/hsl/default/1680267332835_add-scheduled-stop-point-numeric-id/up.sql line 10 at r2 (raw file):
Previously, culka (Teemu Mäkinen) wrote…
This sounds potentially very bad.
Luckily we can currently ignore pre-existing values.
Discussed this elsewhere.
Proceeding with this. Other possible solutions that we could think of feel more complex than this legacy-support-field deserves.
migrations/hsl/default/2000000001002_R_after_migrate_scheduled_stop_point/up.sql line 2 at r2 (raw file):
Previously, culka (Teemu Mäkinen) wrote…
I like BETWEEN. But it does the same thing.
👍 changed.
Leitsi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @culka)
scripts/specific-schema.sh line 1 at r2 (raw file):
Previously, culka (Teemu Mäkinen) wrote…
This file probably should not be included
Fixed now that this is rebased correctly.
5d16539 to
970b311
Compare
jarkkoka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 4 files at r2, 2 of 2 files at r3, 11 of 11 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @culka and @Leitsi)
migrations/hsl/default/1680785812130_set_jore3_importer_tables_ownership/up.sql line 17 at r4 (raw file):
ALTER TABLE route.line OWNER TO dbimporter; ALTER TABLE service_pattern.vehicle_mode_on_scheduled_stop_point OWNER TO dbimporter; ALTER TABLE service_pattern.scheduled_stop_point OWNER TO dbimporter;
Hmmm... I'm wondering whether everything works without changing ownership of service_pattern.scheduled_stop_point_invariant table which is written via triggers.
Code quote:
ALTER TABLE service_pattern.scheduled_stop_point OWNER TO dbimporter;
culka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Leitsi)
Leitsi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @jarkkoka)
migrations/hsl/default/1680785812130_set_jore3_importer_tables_ownership/up.sql line 17 at r4 (raw file):
Previously, jarkkoka (Jarkko Kaura) wrote…
Hmmm... I'm wondering whether everything works without changing ownership of
service_pattern.scheduled_stop_point_invarianttable which is written via triggers.
Should work. The only really necessary thing here are the scheduled_stop_point changes, they were required for truncates work with sequences. Changed others as well for consistency. At least the scheduled_stop_point_invariant is not truncated by the importer, even via cascades.
12384cb to
0d78c84
Compare
…user Mainly so that the importer can reset sequences on truncate.
To be used for some exports instead of UUIDs.
Shorter, and now more consistent with other similar constraints.
…s to HSL schema Separate commit to better highlight actual modifications in next one.
We need this for Jore3 importer.
0d78c84 to
fa3d1c7
Compare
This change is