Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
improve migration to blockified templates (#10415)
Browse files Browse the repository at this point in the history
  • Loading branch information
gigitux authored and thealexandrelara committed Aug 7, 2023
1 parent 1807570 commit 15d9b37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ class Migration {
*/
public function run_migrations() {
$current_db_version = get_option( Options::WC_BLOCK_VERSION, '' );
$schema_version = get_option( 'wc_blocks_db_schema_version', '' );

// This check is necessary because the version was not being set in the database until 10.3.0.
// Checking wc_blocks_db_schema_version determines if it's a fresh install (value will be empty)
// or an update from WC Blocks older than 10.3.0 (it will have some value). In the latter scenario
// we should run the migration.
// We can remove this check in the next months.
if ( ! empty( get_option( 'wc_blocks_db_schema_version', '' ) ) ) {
if ( ! empty( $schema_version ) && ( empty( $current_db_version ) ) ) {
$this->wc_blocks_update_1030_blockified_product_grid_block();
}

Expand Down

0 comments on commit 15d9b37

Please sign in to comment.