Skip to content

Commit

Permalink
ROR-395 Add script for setting from date for max version. Remove vers…
Browse files Browse the repository at this point in the history
…ion_comment as it could be confusing
  • Loading branch information
csolem committed Jun 15, 2018
1 parent b66aca4 commit 579d7da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
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
)

)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
UPDATE tariff_zone
SET to_date=now(), version_comment = 'ROR-395 Terminating old versions manually'
SET to_date=now() - interval '1 day'
WHERE id IN
(
SELECT tz.id
Expand All @@ -9,5 +9,5 @@ WHERE id IN
FROM tariff_zone tz2
WHERE tz2.netex_id = tz.netex_id
)
AND tz.to_date IS NOT NULL

)

0 comments on commit 579d7da

Please sign in to comment.