-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add Shipping Max time column in gla_shipping_times Table #2520
Add Shipping Max time column in gla_shipping_times Table #2520
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## update/shippings-settings-phase-1 #2520 +/- ##
===================================================================
Coverage ? 65.0%
Complexity ? 4585
===================================================================
Files ? 476
Lines ? 17898
Branches ? 0
===================================================================
Hits ? 11626
Misses ? 6272
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more.
|
* @return void | ||
*/ | ||
public function apply(): void { | ||
if ( $this->shipping_time_table->exists() && ! $this->shipping_time_table->has_column( 'max_time' ) ) { |
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.
Since the table installation happens earlier (even if the table already exists) and is handled by the delta function, the table should already be updated, so this code likely won't run. However, I think it's a good idea to keep it as a precaution.
google-listings-and-ads/src/DB/Table.php
Line 45 in 9f669d4
$this->wp->db_delta( $this->get_install_query() ); |
https://developer.wordpress.org/reference/functions/dbdelta/
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.
9edf689
into
update/shippings-settings-phase-1
Changes proposed in this Pull Request:
Part of pcTzPl-2qP-p2
This PR updates the DB to support minimum and maximum shipping times. We'll keep the existing
time
column (which will be used as min time) for backwards compatibility and add a new column calledmax_time
, which will be populated with the current values from thetime
column for existing users.Once the UI is set up to handle max and min times, we’ll update the backend to manage these new columns accordingly.
Screenshots:
Detailed test instructions:
2.8.1
gla_db_version
option to an older version, such as 2.8.0, so that the migration class is triggered.:UPDATE wp_options SET option_value = '2.8.0' WHERE option_name = 'gla_db_version';
max_time
and is populated with the values used intime
.Additional details:
I didn’t include tests since this code will only run once.
Changelog entry