[ "type" => "INT", "constraint" => 16, "unsigned" => true, "null" => true ], "presupuesto_id" => [ "type" => "INT", "constraint" => 10, "unsigned" => true, "null" => true ], "factura_id" => [ "type" => "INT", "constraint" => 10, "unsigned" => true, "null" => true ], ]; public function up() { $this->forge->addColumn("chat_department_users",$this->COLUMNS); $this->forge->addForeignKey('pedido_id', 'pedidos', 'id'); $this->forge->addForeignKey('factura_id', 'facturas', 'id'); $this->forge->addForeignKey('presupuesto_id', 'presupuestos', 'id'); } public function down() { $this->forge->dropForeignKey("chat_department_users","pedido_id"); $this->forge->dropForeignKey("chat_department_users","factura_id"); $this->forge->dropForeignKey("chat_department_users","presupuesto_id"); $this->forge->dropColumn("chat_department_users",["pedido_id","factura_id","presupuesto_id"]); } }