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; } } }