-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[DB] Add NoCatchup field to Job db model #3129
Conversation
@@ -23,6 +23,7 @@ type Job struct { | |||
Namespace string `gorm:"column:Namespace; not null;"` | |||
Description string `gorm:"column:Description; not null"` | |||
MaxConcurrency int64 `gorm:"column:MaxConcurrency;not null"` | |||
NoCatchup bool `gorm:"column:NoCatchup; not null"` |
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.
Just want to double check on how mysql handles this schema change. When the new column is added, the existing rows don't have value for this column. Since the column is said to be not null, what would be the default value be used or upgrade doesn't go through?
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.
That's a good point. I think default value will be false, but I'm not sure, let me double check on a real db.
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.
mysql> select Name, NoCatchup from jobs;
+-----------------------------+-----------+
| Name | NoCatchup |
+-----------------------------+-----------+
| periodic-catchup-falsehtrd9 | 0 |
| cron-catchup-true6km84 | 0 |
| periodic-catchup-truezcwhs | 0 |
| periodic-catchup-falsefd272 | 0 |
| catchupfalsesslv8 | 0 |
| cron-catchup-falsemx58x | 0 |
| periodic-catchup-true-znwf8 | 0 |
| catchuptruec9vr6 | 0 |
| periodic-catchup-truekdq5d | 0 |
| cron-catchup-falsefcpdl | 0 |
| periodic-catchup-truenn4qr | 0 |
| cron-catchup-true6qxdq | 0 |
+-----------------------------+-----------+
12 rows in set (0.00 sec)
Looks like it's correct, this column will be auto populated with false, so it matches backward compatible behavior.
Only a nit question inline. |
@jingzhang36 thanks! /hold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bobgy, jingzhang36 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/lgtm |
/retest |
* Add noCatchup field to Job db model * Add scheduledworkflow cloudbuild yaml to facilitate local testing * Add no catchup to api converter too
/assign @IronPan
/assign @jingzhang36
Part of #3055
Recommend hiding whitespace difference when reviewing, because there seems to be some format inconsistency.
This change is