From 01a0d5ae6603999e572ad65466187b50d8cba388 Mon Sep 17 00:00:00 2001 From: Hotlander Date: Thu, 24 Oct 2019 23:19:18 +0200 Subject: [PATCH 1/4] - removed self.version from package composer.json files --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7ef16997c..58eb6d055 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "require": { "php": ">=7.1.26", "oro/platform-enterprise": "~3.1.1", - "marellocommerce/marello": "self.version" + "marellocommerce/marello": "~2.2.0" }, "minimum-stability": "dev", "prefer-stable": true, From 0ef03ef550c7de0c7a1399ce17abfbd3db10f414 Mon Sep 17 00:00:00 2001 From: Hotlander Date: Fri, 8 Nov 2019 09:32:55 +0100 Subject: [PATCH 2/4] - updated branch aliases --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index dd3e7bd8d..b8f7252c9 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "prefer-stable": true, "extra": { "branch-alias": { - "dev-master": "2.1-dev" + "dev-master": "2.2-dev" } }, "autoload": { From 68f88547c3bb87fbf2563edef59aeb4c36cbb1c5 Mon Sep 17 00:00:00 2001 From: Hotlander Date: Tue, 19 Nov 2019 12:18:03 +0100 Subject: [PATCH 3/4] - Added data column to PurchaseOrder --- .../v1_3_2/MarelloPurchaseOrderBundle.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_2/MarelloPurchaseOrderBundle.php diff --git a/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_2/MarelloPurchaseOrderBundle.php b/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_2/MarelloPurchaseOrderBundle.php new file mode 100644 index 000000000..72d9cb2b2 --- /dev/null +++ b/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_2/MarelloPurchaseOrderBundle.php @@ -0,0 +1,35 @@ +updatePurchaseOrderTable($schema); + } + + /** + * @param Schema $schema + * @throws \Doctrine\DBAL\Schema\SchemaException + */ + protected function updatePurchaseOrderTable(Schema $schema) + { + $table = $schema->getTable('marello_purchase_order'); + if (!$table->hasColumn('data')) { + $table->addColumn('data', 'json_array', ['notnull' => false, 'comment' => '(DC2Type:json_array)']); + } + } +} From cf42176085598c709f330d59054c3675de9e934e Mon Sep 17 00:00:00 2001 From: Hotlander Date: Tue, 19 Nov 2019 14:26:28 +0100 Subject: [PATCH 4/4] - Added migration to include organization id on the purchase order item --- .../MarelloPurchaseOrderBundleInstaller.php | 2 +- .../v1_3_3/MarelloPurchaseOrderBundle.php | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_3/MarelloPurchaseOrderBundle.php diff --git a/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/MarelloPurchaseOrderBundleInstaller.php b/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/MarelloPurchaseOrderBundleInstaller.php index 81aaf7070..5349baf72 100644 --- a/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/MarelloPurchaseOrderBundleInstaller.php +++ b/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/MarelloPurchaseOrderBundleInstaller.php @@ -24,7 +24,7 @@ class MarelloPurchaseOrderBundleInstaller implements */ public function getMigrationVersion() { - return 'v1_3_1'; + return 'v1_3_3'; } /** diff --git a/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_3/MarelloPurchaseOrderBundle.php b/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_3/MarelloPurchaseOrderBundle.php new file mode 100644 index 000000000..6ad3ec5b3 --- /dev/null +++ b/src/Marello/Bundle/PurchaseOrderBundle/Migrations/Schema/v1_3_3/MarelloPurchaseOrderBundle.php @@ -0,0 +1,49 @@ +updatePurchaseOrderItemTable($schema); + } + /** + * @param Schema $schema + * @throws \Doctrine\DBAL\Schema\SchemaException + */ + protected function updatePurchaseOrderItemTable(Schema $schema) + { + $table = $schema->getTable('marello_purchase_order_item'); + if (!$table->hasColumn('organization_id')) { + $table->addColumn('organization_id', 'integer', ['notnull' => false]); + } + + if (!$table->hasIndex('IDX_3483BD8632C8A3DE')) { + // add index to organization column + $table->addIndex(['organization_id']); + } + + if (!$table->hasForeignKey('FK_3483BD8632C8A3DE')) { + // add foreign key constraint + $table->addForeignKeyConstraint( + $schema->getTable('oro_organization'), + ['organization_id'], + ['id'], + ['onDelete' => 'SET NULL', 'onUpdate' => null] + ); + } + } +}