Skip to content
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

schemas, migration: set TVM signals sight distance to zero #7040

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE infra_object_signal
SET data = jsonb_set(data, '{sight_distance}', '400.0')
WHERE '"TVM300"'::jsonb <@ jsonb_path_query_array(data, '$.logical_signals[*].signaling_system')
OR '"TVM430"'::jsonb <@ jsonb_path_query_array(data, '$.logical_signals[*].signaling_system');
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE infra_object_signal
SET data = jsonb_set(data, '{sight_distance}', '0.0')
WHERE '"TVM300"'::jsonb <@ jsonb_path_query_array(data, '$.logical_signals[*].signaling_system')
OR '"TVM430"'::jsonb <@ jsonb_path_query_array(data, '$.logical_signals[*].signaling_system');
2 changes: 1 addition & 1 deletion front/src/reducers/osrdconf/infra_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@
},
"sight_distance": {
"description": "Visibility distance of the signal in meters",
"exclusiveMinimum": 0.0,
"minimum": 0.0,
"title": "Sight Distance",
"type": "number"
},
Expand Down
2 changes: 1 addition & 1 deletion python/osrd_schemas/osrd_schemas/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class Signal(BaseObjectTrait, TrackLocationTrait):
"""

direction: Direction = Field(description="Direction of use of the signal")
sight_distance: float = Field(description="Visibility distance of the signal in meters", gt=0)
sight_distance: float = Field(description="Visibility distance of the signal in meters", ge=0)
logical_signals: List[LogicalSignal] = Field(
description="Logical signals bundled into this physical signal", default_factory=list
)
Expand Down
2 changes: 1 addition & 1 deletion python/osrd_schemas/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "osrd_schemas"
version = "0.8.9"
version = "0.8.10"
description = ""
authors = ["OSRD <[email protected]>"]

Expand Down
2 changes: 1 addition & 1 deletion python/railjson_generator/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading