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

DM-48437: Add migration script for schema 5.0.0 #8

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

abudlong
Copy link
Contributor

No description provided.

@abudlong abudlong requested a review from andy-slac January 15, 2025 20:29
Copy link
Collaborator

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks good. We also need to add a short description to doc/lsst.dax.apdb_migrate/migrations/sql/schema.rst.

def upgrade() -> None:
"""Upgrade 'schema' tree from 4.0.0 to 5.0.0 (ticket DM-48437).
Summary of changes:
- Add empty dipoleFitAttempted column.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Add empty dipoleFitAttempted column.
- Add empty is_negative column.

def downgrade() -> None:
"""Downgrade 'schema' tree from 5.0.0 to 4.0.0 (ticket DM-48437).
Summary of changes:
- Remove empty dipoleFitAttempted column.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Remove empty dipoleFitAttempted column.
- Remove empty is_negative column.

ctx = Context()

# Alter table schema.
_LOG.info("Dropping column to DiaSource table.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_LOG.info("Dropping column to DiaSource table.")
_LOG.info("Dropping column from DiaSource table.")

@abudlong abudlong force-pushed the tickets/DM-48437 branch 2 times, most recently from 6f28add to ed1a170 Compare January 15, 2025 23:08
Copy link
Collaborator

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks great.

@abudlong abudlong merged commit 3d4e86f into main Jan 15, 2025
7 checks passed
@abudlong abudlong deleted the tickets/DM-48437 branch January 15, 2025 23:25
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.

2 participants