From 71e0fd92d60d11a773b3123836e01a03bc34893d Mon Sep 17 00:00:00 2001 From: Nestor Soriano Date: Thu, 19 May 2022 10:26:59 +0200 Subject: [PATCH] Move the base table migration classes outside CustomOrderTable directory These classes are generic and don't depend on the custom orders table functionality, so they are moved from src/Database/Migrations/CustomOrderTable to just src/Database/Migrations. --- .../CustomOrderTable/PostMetaToOrderMetaMigrator.php | 2 ++ .../CustomOrderTable/PostToOrderAddressTableMigrator.php | 2 ++ .../CustomOrderTable/PostToOrderOpTableMigrator.php | 2 ++ .../Migrations/CustomOrderTable/PostToOrderTableMigrator.php | 2 ++ .../{CustomOrderTable => }/MetaToCustomTableMigrator.php | 4 +--- .../{CustomOrderTable => }/MetaToMetaTableMigrator.php | 4 +--- .../Migrations/{CustomOrderTable => }/TableMigrator.php | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) rename plugins/woocommerce/src/Database/Migrations/{CustomOrderTable => }/MetaToCustomTableMigrator.php (99%) rename plugins/woocommerce/src/Database/Migrations/{CustomOrderTable => }/MetaToMetaTableMigrator.php (99%) rename plugins/woocommerce/src/Database/Migrations/{CustomOrderTable => }/TableMigrator.php (98%) diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostMetaToOrderMetaMigrator.php b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostMetaToOrderMetaMigrator.php index 79b0347130b..a10720d2b4f 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostMetaToOrderMetaMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostMetaToOrderMetaMigrator.php @@ -5,6 +5,8 @@ namespace Automattic\WooCommerce\Database\Migrations\CustomOrderTable; +use Automattic\WooCommerce\Database\Migrations\MetaToMetaTableMigrator; + /** * Helper class to migrate records from the WordPress post meta table * to the custom orders meta table. diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderAddressTableMigrator.php b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderAddressTableMigrator.php index aeb8e8ed297..aa19ccfe3ba 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderAddressTableMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderAddressTableMigrator.php @@ -5,6 +5,8 @@ namespace Automattic\WooCommerce\Database\Migrations\CustomOrderTable; +use Automattic\WooCommerce\Database\Migrations\MetaToCustomTableMigrator; + /** * Helper class to migrate records from the WordPress post table * to the custom order addresses table. diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderOpTableMigrator.php b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderOpTableMigrator.php index 848680422c6..05f22f6d1d0 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderOpTableMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderOpTableMigrator.php @@ -5,6 +5,8 @@ namespace Automattic\WooCommerce\Database\Migrations\CustomOrderTable; +use Automattic\WooCommerce\Database\Migrations\MetaToCustomTableMigrator; + /** * Helper class to migrate records from the WordPress post table * to the custom order operations table. diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderTableMigrator.php b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderTableMigrator.php index 6d8cc84e539..663f5fccd85 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderTableMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/PostToOrderTableMigrator.php @@ -5,6 +5,8 @@ namespace Automattic\WooCommerce\Database\Migrations\CustomOrderTable; +use Automattic\WooCommerce\Database\Migrations\MetaToCustomTableMigrator; + /** * Helper class to migrate records from the WordPress post table * to the custom order table (and only that table - PostsToOrdersMigrationController diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/MetaToCustomTableMigrator.php b/plugins/woocommerce/src/Database/Migrations/MetaToCustomTableMigrator.php similarity index 99% rename from plugins/woocommerce/src/Database/Migrations/CustomOrderTable/MetaToCustomTableMigrator.php rename to plugins/woocommerce/src/Database/Migrations/MetaToCustomTableMigrator.php index fd3b899259c..b0ff9c946ac 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/MetaToCustomTableMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/MetaToCustomTableMigrator.php @@ -3,9 +3,7 @@ * Generic migration class to move any entity, entity_meta table combination to custom table. */ -namespace Automattic\WooCommerce\Database\Migrations\CustomOrderTable; - -use Automattic\WooCommerce\Database\Migrations\MigrationHelper; +namespace Automattic\WooCommerce\Database\Migrations; /** * Base class for implementing migrations from the standard WordPress meta table diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/MetaToMetaTableMigrator.php b/plugins/woocommerce/src/Database/Migrations/MetaToMetaTableMigrator.php similarity index 99% rename from plugins/woocommerce/src/Database/Migrations/CustomOrderTable/MetaToMetaTableMigrator.php rename to plugins/woocommerce/src/Database/Migrations/MetaToMetaTableMigrator.php index 0fad471c326..f43a1769a74 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/MetaToMetaTableMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/MetaToMetaTableMigrator.php @@ -3,9 +3,7 @@ * Generic Migration class to move any meta data associated to an entity, to a different meta table associated with a custom entity table. */ -namespace Automattic\WooCommerce\Database\Migrations\CustomOrderTable; - -use Automattic\WooCommerce\Database\Migrations\MigrationHelper; +namespace Automattic\WooCommerce\Database\Migrations; /** * Base class for implementing migrations from the standard WordPress meta table diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/TableMigrator.php b/plugins/woocommerce/src/Database/Migrations/TableMigrator.php similarity index 98% rename from plugins/woocommerce/src/Database/Migrations/CustomOrderTable/TableMigrator.php rename to plugins/woocommerce/src/Database/Migrations/TableMigrator.php index 7c09817bf2d..7d43fbc3948 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/TableMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/TableMigrator.php @@ -3,7 +3,7 @@ * Base class for all the WP posts to order table migrator. */ -namespace Automattic\WooCommerce\Database\Migrations\CustomOrderTable; +namespace Automattic\WooCommerce\Database\Migrations; /** * Base class for implementing WP posts to order tables migrations handlers.