forge->addField([ 'id' => [ 'type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true, ], 'group_id' => [ 'type' => 'INT', 'constraint' => 11, 'unsigned' => true, ], 'data_key' => [ 'type' => 'VARCHAR', 'constraint' => 100, ], 'data_value' => [ 'type' => 'TEXT', ], 'created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', 'updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', 'system' => [ 'type' => 'TINYINT', 'constraint' => 1, 'default' => 0, ], ]); $this->forge->addKey('id', true); $this->forge->addForeignKey('group_id', $config->dbTableGroups, 'id'); $this->forge->createTable($config->dbTableGroupVariables, true); } //-------------------------------------------------------------------- /** * Drops Table * * @return void */ public function down() { $config = new AauthConfig(); $this->forge->dropForeignKey($config->dbTableGroupVariables, $config->dbTableGroupVariables . '_group_id_foreign'); $this->forge->dropTable($config->dbTableGroupVariables, true); } }