8000 GVT-2934 Fix segments in alignment history that have the same switch joint at both ends by jyrkija · Pull Request #1771 · finnishtransportagency/geoviite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

jyrkija
Copy link
Contributor
@jyrkija jyrkija commented Jun 4, 2025

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ä.

@@ -0,0 +1,59 @@
drop table if exists tmp_faulty_segments;
Copy link
Contributor Author

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(
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Copy link
Contributor
@juuseko juuseko left a 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.

@jyrkija
Copy link
Contributor Author
jyrkija commented Jun 5, 2025

👍

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

@jyrkija jyrkija merged commit a2a15f3 into main Jun 5, 2025
4 checks passed
@jyrkija jyrkija deleted the dev/GVT-2934 branch June 5, 2025 09:37
Copy link
Contributor
@solita-mrunsten solita-mrunsten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0