-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ROR-395 Add script for setting from date for max version. Remove vers…
…ion_comment as it could be confusing
- Loading branch information
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
ROR-395_enable_tariff_zone_versioning/set_from_date_max_version.sql
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,13 @@ | ||
UPDATE tariff_zone | ||
SET from_date=now() - interval '1 day', changed=now() | ||
WHERE id IN | ||
( | ||
SELECT tz.id | ||
FROM tariff_zone tz | ||
WHERE tz.version = ( | ||
SELECT MAX(tz2.version) | ||
FROM tariff_zone tz2 | ||
WHERE tz2.netex_id = tz.netex_id | ||
) | ||
|
||
) |
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