forge->addField([ 'VID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'SiteID' => ['type' => 'INT', 'null' => true], 'VSetID' => ['type' => 'INT', 'null' => true], 'VOrder' => ['type' => 'INT', 'null' => true], 'VValue' => ['type' => 'varchar', 'constraint' => 10], 'VDesc' => ['type' => 'varchar', 'constraint' => 255, 'null' => true], 'VCategory' => ['type' => 'int', 'null' => true], 'EndDate' => ['type' => 'DATETIME', 'null' => true] ]); $this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP'); $this->forge->addKey('VID', true); $this->forge->createTable('valueset'); $this->forge->addField([ 'VSetID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'SiteID' => ['type' => 'INT', 'null' => true], 'VSName' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false], 'VSDesc' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => false], 'EndDate' => ['type' => 'DATETIME', 'null' => true] ]); $this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP'); $this->forge->addKey('VSetID', true); $this->forge->createTable('valuesetdef'); } public function down() { $this->forge->dropTable('valueset'); $this->forge->dropTable('valuesetdef'); } }