-
Notifications
You must be signed in to change notification settings - Fork 476
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
Adjust migration settings based on database engine #2236
Adjust migration settings based on database engine #2236
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe recent update involves modifying the database schema by adding a new column to the primary key of the input artifact table. This includes dropping the existing primary key constraint and creating a new one that incorporates the additional column. The downgrade process is also catered for, which involves reverting the changes based on the specific database engine being used. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: .coderabbit.yaml
Files selected for processing (1)
- src/zenml/zen_stores/migrations/versions/728c6369cfaa_add_name_column_to_input_artifact_pk.py (2 hunks)
Additional comments: 2
src/zenml/zen_stores/migrations/versions/728c6369cfaa_add_name_column_to_input_artifact_pk.py (2)
52-52: The
upgrade
function correctly drops and recreates the primary key constraint. However, ensure that this operation is safe and does not lead to data inconsistencies, especially in a production environment.131-142: The conditional logic for setting session variables based on the database engine and version is well-implemented. However, it's crucial to ensure that these settings are only temporary and do not persist beyond the scope of the migration, as they could have unintended side effects.
src/zenml/zen_stores/migrations/versions/728c6369cfaa_add_name_column_to_input_artifact_pk.py
Outdated
Show resolved
Hide resolved
…b.com:zenml-io/zenml into bugfix/disable-mariadb-incompatible-migration
This pull request adjusts the migration settings based on the requirements of the database engine. It fixes the primary key requirement for MySQL and MariaDB engines.
We want to run DB migration testing for MariaDB following #2155, but before we can do that, we need to fix this one migration which is incompatible with MariaDB. I added a check for mariadb and execute a similar setting of the variable, but note that it is only able to be set globally.
Summary by CodeRabbit