forge->addField([ 'invoice_item_id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true], 'product_id' => ['type' => 'INT', 'unsigned' => true], 'created_at' => ['type' => 'DATETIME', 'null' => true], 'updated_at' => ['type' => 'DATETIME', 'null' => true], 'deleted_at' => ['type' => 'DATETIME', 'null' => true], ]); $this->forge->addKey('invoice_item_id', true); $this->forge->addForeignKey('product_id', 'product', 'product_id', 'CASCADE', 'CASCADE'); $this->forge->createTable('invoice_item'); } public function down() { $this->forge->dropTable('invoice_item'); } }