diff --git a/Admin/Installer.php b/Admin/Installer.php index 2892959..7285191 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -20,7 +20,7 @@ use phpOMS\Module\InfoManager; use phpOMS\Module\InstallerAbstract; /** - * Production install class. + * Installer class. * * @package Modules\Production\Admin * @license OMS License 1.0 @@ -29,67 +29,4 @@ use phpOMS\Module\InstallerAbstract; */ class Installer extends InstallerAbstract { - - /** - * {@inheritdoc} - */ - public static function install(DatabasePool $dbPool, InfoManager $info) : void - { - parent::install($dbPool, $info); - - switch ($dbPool->get()->getType()) { - case DatabaseType::MYSQL: - $dbPool->get()->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'production_process` ( - `ProcessID` int(11) NOT NULL AUTO_INCREMENT, - `product` int(11) NOT NULL, - `status` tinyint(2) NOT NULL, - `quantity` int(11) NOT NULL, - `for` int(11) NULL, - `orderer` int(11) NULL, - `ordered` datetime DEFAULT NULL, - `due` datetime DEFAULT NULL, - `planned` datetime DEFAULT NULL, - `started` datetime DEFAULT NULL, - `done` datetime DEFAULT NULL, - PRIMARY KEY (`ProcessID`), - KEY `product` (`product`), - KEY `for` (`for`), - KEY `orderer` (`orderer`) - )ENGINE=InnoDB DEFAULT CHARSET=utf8;' - )->execute(); - - /*$dbPool->get()->con->prepare( - 'ALTER TABLE `' . $dbPool->get()->prefix . 'production_process` - ADD CONSTRAINT `' . $dbPool->get()->prefix . 'production_process_ibfk_1` FOREIGN KEY (`creator`) REFERENCES `' . $dbPool->get()->prefix . 'account` (`account_id`);' - )->execute();*/ - - $dbPool->get()->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'production_guideline` ( - `ProductionGuidelineID` int(11) NOT NULL AUTO_INCREMENT, - `product` int(11) NOT NULL, - PRIMARY KEY (`ProductionGuidelineID`), - KEY `product` (`product`) - )ENGINE=InnoDB DEFAULT CHARSET=utf8;' - )->execute(); - - $dbPool->get()->con->prepare( - 'CREATE TABLE if NOT EXISTS `' . $dbPool->get()->prefix . 'production_guideline_step` ( - `ProductionStepID` int(11) NOT NULL AUTO_INCREMENT, - `guideline` int(11) NOT NULL, - `title` varchar(50) NOT NULL, - `text` text NOT NULL, - `order` tinyint(3) NOT NULL, - PRIMARY KEY (`ProductionStepID`), - KEY `guideline` (`guideline`) - )ENGINE=InnoDB DEFAULT CHARSET=utf8;' - )->execute(); - - $dbPool->get()->con->prepare( - 'ALTER TABLE `' . $dbPool->get()->prefix . 'production_guideline_step` - ADD CONSTRAINT `' . $dbPool->get()->prefix . 'production_guideline_step_ibfk_1` FOREIGN KEY (`guideline`) REFERENCES `' . $dbPool->get()->prefix . 'production_guideline` (`ProductionGuidelineID`);' - )->execute(); - break; - } - } }