fix: migrate 'None' Strings to NULL in Changes Table#2620
fix: migrate 'None' Strings to NULL in Changes Table#2620ReimarBauer merged 6 commits intoOpen-MSS:developfrom
Conversation
ReimarBauer
left a comment
There was a problem hiding this comment.
please read in develop the documentation https://github.com/Open-MSS/MSS/blob/develop/docs/development.rst#changing-the-database-model
and incorporate the change into the existing migration script.
done. can u plz review it? |
|
@anj20 look on the tests |
updated the function to pass the case for sqlite |
|
the setup has some problems https://github.com/Open-MSS/MSS/actions/runs/13144536253/job/36709434618?pr=2620#step:9:30573 |
ReimarBauer
left a comment
There was a problem hiding this comment.
the setup has some problems https://github.com/Open-MSS/MSS/actions/runs/13144536253/job/36709434618?pr=2620#step:9:30573
105 errors
| with op.batch_alter_table('users', schema=None) as batch_op: | ||
| batch_op.add_column(sa.Column('profile_image_path', sa.String(length=255), nullable=True)) | ||
|
|
||
| with op.batch_alter_table('changes', schema=None) as batch_op: |
There was a problem hiding this comment.
I have in the past stored the version_name and the comment default as string 'None''. And now I want to convert these values to None.
I think the solution is to just do that in upgrade, op.execute(
"UPDATE changes SET version_name = NULL WHERE version_name = 'None';"
)
and in the downgrade just the opposite
op.execute(
"UPDATE changes SET version_name = 'None' WHERE version_name IS NULL;"
)
feel free to add the other one
There was a problem hiding this comment.
still it is failing some test case
There was a problem hiding this comment.
two because of timeout and the third is independent to your change
FAILED tests/_test_msui/test_sideview.py::Test_SideViewWMS::test_server_getmap - pytestqt.exceptions.TimeoutError: Signal canceled() not emitted after 5000 ms
FAILED tests/_test_msui/test_topview.py::Test_TopViewWMS::test_server_getmap - pytestqt.exceptions.TimeoutError: Signal canceled() not emitted after 5000 ms
FAILED tests/_test_mswms/test_mss_plot_driver.py::Test_VSec::test_VS_HorizontalVelocityStyle_01 - Failed: CALL ERROR: Exceptions caught in Qt event loop:
There was a problem hiding this comment.
hi @ReimarBauer ,
i am not getting the reason why this test case is getting time out. I think it's not related to the changes i made.
Purpose of PR?: This PR fixes incorrect storage of "None" as a string and ensures it is properly migrated to NULL.
Fixes #2590
Does this PR introduce a breaking change? No, this PR does not introduce any breaking changes. It only updates stored data to ensure consistency.
Checklist:
<type>: <subject>