[ "type" => "INT", "unsigned" => true, "autoincrement" => true ], "chat_department_id" => [ "type" => "INT", "unsigned" => true, ], "pedido_id" => [ "type" => "INT", "constraint" => 16, "unsigned" => true, ], ]; public function up() { $this->forge->dropTable("chat_conversaciones",true); $this->forge->dropTable("chat_mensajes",true); $this->forge->dropTable("chat_participantes",true); $this->forge->addField($this->COLUMNS); $currenttime = new RawSql("CURRENT_TIMESTAMP"); $this->forge->addField([ "created_at" => [ "type" => "TIMESTAMP", "default" => $currenttime, ], "updated_at" => [ "type" => "TIMESTAMP", "nullable" => true, ], "deleted_at" => [ "type" => "TIMESTAMP", "nullable" => true, ], ]); $this->forge->addPrimaryKey('id'); $this->forge->addForeignKey('pedido_id', 'pedidos', 'id'); // $this->forge->addForeignKey('chat_department_id', 'chat_departments', 'id'); $this->forge->createTable("chats",true); } public function down() { // $this->forge->dropTable("chats",true); } }