-
Notifications
You must be signed in to change notification settings - Fork 54
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
update-ht-task-fk-for-mysql-8-4 #1950
Conversation
WalkthroughWalkthroughThe 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 Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
spiffworkflow-backend/migrations/versions/3191627ae224_.py
is excluded by!spiffworkflow-backend/migrations/**
Files selected for processing (1)
- spiffworkflow-backend/bin/recreate_db (4 hunks)
Additional comments not posted (6)
spiffworkflow-backend/bin/recreate_db (6)
29-32
: Validation forSPIFFWORKFLOW_BACKEND_ENV
is correct.The validation ensures that the environment variable is set to either 'local_development' or 'unit_testing', preventing misconfiguration.
38-38
: Introduction ofdatabases_to_run_on
variable is correct.The variable
databases_to_run_on
is used to manage multiple databases, which is useful for handling different environments.
47-50
: Modification ofdatabase_name_from_uri
is correct.The logic extracts the database name from the URI and updates
databases_to_run_on
if the extracted name is not already in the list, ensuring the correct database is targeted.
64-69
: Addition ofrun_command_on_mysql_databases
function is correct.The function iterates over
databases_to_run_on
and executes the given command on each database, efficiently handling multiple databases.
85-85
: Usage ofrun_command_on_mysql_databases
function is correct.The function is used to drop and create databases based on the specified environment, ensuring consistent database management.
Also applies to: 119-119
126-128
: Adjustment of database URI for unit testing is correct.The conditional block ensures that the database URI is correctly set for unit testing, preventing potential issues during testing.
This updates the migration that adds a foreign key from human_task.task_guid to task.guid. This migration had issues with mysql 8.4 which no longer allows foreign keys on non-standard keys.
More info:
https://dev.mysql.com/doc/refman/8.4/en/server-system-variables.html#sysvar_restrict_fk_on_non_standard_key
https://bugs.mysql.com/bug.php?id=114838