-
Notifications
You must be signed in to change notification settings - Fork 0
GVT-2934 Fix segments in alignment history that have the same switch joint at both ends #1771
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
Conversation
…joint at both ends
@@ -0,0 +1,59 @@ | |||
drop table if exists tmp_faulty_segments; |
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.
Ehkä vähän ylivarovainen tapa muokata tuota dataa mutta...
do | ||
$$ | ||
begin | ||
if exists( |
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.
Koska yhtään aktiivista versiota ei pitäisi löytyä korjattavaksi, varmistetaan se vielä tässä. Jos tuotannossa tuollainen on, migra failaa ja voidaan katsoa mistä kyse.
set | ||
switch_start_joint_number = | ||
case | ||
when switch_start_joint_number = 1 and switch_id in (696, 1274, 3251) then 2 |
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.
Suunta: tarkastin nämä vaihteet että kumpaan suuntaan ne kasvaa ja kovakoodasin tänne id:llä tuon korjauksen suunnan vastaavaksi. En tiedä kuinka tärkeää tämä oikeastaan edes on, mutta tuntui kuitenkin varmemmalta.
Koska tuota ei ole helppo nähdä täällä sql:ssä ja tein selvittelyn manuaalisesti, vain nuo tietyt raiteet muokataan...
and f.segment_index = s.segment_index | ||
); | ||
|
||
do |
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.
... ja sitten tarkastetaan ettei muita ole. Jälleen, jos näitä on tuotannossa ilmestynyt lisää niin se olisi jokseenkin ylläri - käsitellään ne sitten tilanteen mukaan.
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.
👍
Olihan tästä muuten testattu että tämä migra menee OK:sti läpi tyhjällä kannalla (esim. testikannan setuppaus)? En nähnyt itse koodissa mitään syytä miksi noin ei olisi, mutta ajattelin kumminkin kysyä varmuuden vuoksi.
Joo on testattu ja toimii |
a2a15f3
into
main
Uh oh!
There was an error while loading. Please reload this page.
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.
👍
Näitä on historiallisessa datassa muutama (ei yhtään aktiviisilla raiteilla), joten korjataan pohjalle ennen kuin tehdään graafimalli tuosta. Nämä siis näyttäytyisi edgeinä jotka päätyvät takaisin samaan noodiin, missä ei ole mitään järkeä.