From 5392a4c029be47a2877f5f659358a1236d67e796 Mon Sep 17 00:00:00 2001 From: Frantisek Barancik Date: Fri, 15 Apr 2022 14:02:08 +0200 Subject: [PATCH] - database schema change to declarative schema --- Setup/InstallSchema.php | 30 ------------------------------ Setup/UpgradeSchema.php | 40 ---------------------------------------- etc/db_schema.xml | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 70 deletions(-) delete mode 100644 Setup/InstallSchema.php delete mode 100644 Setup/UpgradeSchema.php create mode 100644 etc/db_schema.xml diff --git a/Setup/InstallSchema.php b/Setup/InstallSchema.php deleted file mode 100644 index ea80168..0000000 --- a/Setup/InstallSchema.php +++ /dev/null @@ -1,30 +0,0 @@ -dIContainer = $DIContainer; - } - - public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $setup->startSetup(); - - $this->dIContainer->getSettings()->install(); - - $setup->endSetup(); - } -} diff --git a/Setup/UpgradeSchema.php b/Setup/UpgradeSchema.php deleted file mode 100644 index 249d15c..0000000 --- a/Setup/UpgradeSchema.php +++ /dev/null @@ -1,40 +0,0 @@ -dIContainer = $DIContainer; - } - - /** - * @param SchemaSetupInterface $setup - * @param ModuleContextInterface $context - */ - public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) - { - $setup->startSetup(); - if (version_compare($context->getVersion(), '3.0.7', '<')) { - if (!$setup->tableExists('bulkgate_module')) { - try { - $setup->run("RENAME TABLE `bulkgate_module` TO {$setup->getTable('bulkgate_module')}"); - } catch (\Exception $e) { - $this->dIContainer->getSettings()->install(); - } - } - } - $setup->endSetup(); - } -} diff --git a/etc/db_schema.xml b/etc/db_schema.xml new file mode 100644 index 0000000..1fc9f89 --- /dev/null +++ b/etc/db_schema.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + +
+