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

handle NULLs in migration #1961

Merged
merged 1 commit into from
Oct 18, 2023
Merged
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
Expand Up @@ -33,7 +33,13 @@ def upgrade() -> None:
session = Session(bind=bind)
# update pipeline_deployment
rows_pd = session.execute(
text("SELECT id, step_configurations FROM pipeline_deployment")
text(
"""
SELECT id, step_configurations
FROM pipeline_deployment
WHERE step_configurations IS NOT NULL
"""
)
)
for id_, data in rows_pd:
data_dict = json.loads(data)
Expand All @@ -51,7 +57,13 @@ def upgrade() -> None:

# update step_run
rows_sr = session.execute(
text("SELECT id, step_configuration FROM step_run")
text(
"""
SELECT id, step_configuration
FROM step_run
WHERE step_configuration IS NOT NULL
"""
)
)
for id_, data in rows_sr:
data_dict = json.loads(data)
Expand All @@ -74,7 +86,13 @@ def downgrade() -> None:
session = Session(bind=bind)
# update pipeline_deployment
rows = session.execute(
text("SELECT id,step_configurations FROM pipeline_deployment")
text(
"""
SELECT id,step_configurations
FROM pipeline_deployment
WHERE step_configurations IS NOT NULL
"""
)
)
for id_, data in rows:
data_dict = json.loads(data)
Expand All @@ -92,7 +110,13 @@ def downgrade() -> None:

# update step_run
rows_sr = session.execute(
text("SELECT id, step_configuration FROM step_run")
text(
"""
SELECT id, step_configuration
FROM step_run
WHERE step_configuration IS NOT NULL
"""
)
)
for id_, data in rows_sr:
data_dict = json.loads(data)
Expand Down
Loading