/** */ public function createTable() { $engine = $this->db->getParameter('engine'); $collate = $this->db->getParameter('collate'); $charset = $this->db->getParameter('charset'); $sql = "\n CREATE TABLE IF NOT EXISTS `" . $this->dbTable . "` (\n `object` int(11) NOT NULL,\n `name` varchar(200) COLLATE {$collate} NOT NULL DEFAULT '',\n `value` text COLLATE {$collate},\n PRIMARY KEY (`object`,`name`)\n ) ENGINE={$engine} DEFAULT CHARSET={$charset} COLLATE={$collate}"; $this->db->exec($sql); }
/** * @inheritdoc */ public function install() { $engine = $this->db->getParameter('engine'); $collate = $this->db->getParameter('collate'); $charset = $this->db->getParameter('charset'); $this->db->exec("\n CREATE TABLE IF NOT EXISTS `" . $this->tableName . "` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `name` varchar(150) NOT NULL DEFAULT '',\n PRIMARY KEY (`id`),\n UNIQUE KEY by_name (`name`)\n ) ENGINE={$engine} DEFAULT CHARSET={$charset} COLLATE={$collate}"); $this->metaFactory->createTable(); }