createTable('Servicio', [ "id" => $this->string(36), "factura" => $this->string(100)->notNull(), "tipo" => $this->string(100)->notNull(), "descripcion" => $this->text(), "fechaServicio" => $this->timestamp()->append(" with time zone"), "idTaller" => $this->string(36), "idVehiculo" => $this->string(36), "creado" => $this->timestamp()->append(" with time zone"), "modificado" => $this->timestamp()->append(" with time zone"), "eliminado" => $this->timestamp()->append(" with time zone"), ]); $this->addPrimaryKey("ServicioPK", "Servicio", "id"); $this->addForeignKey("ServicioTallerFK", "Servicio", "idTaller", "Taller", "id"); $this->addForeignKey("ServicioVehiculoFK", "Servicio", "idVehiculo", "Vehiculo", "id"); $this->createTable('ServicioElemento', [ "id" => $this->string(36), "idServicio" => $this->string(36), "elemento" => $this->string(), "costo" => $this->string(100), "descripcion" => $this->string(100), "creado" => $this->timestamp()->append(" with time zone"), "modificado" => $this->timestamp()->append(" with time zone"), "eliminado" => $this->timestamp()->append(" with time zone"), ]); $this->addPrimaryKey("ServicioElementoPK", "ServicioElemento", "id"); $this->addForeignKey("ServicioElementoServicioFK", "ServicioElemento", "idServicio", "Servicio", "id"); } /** * {@inheritdoc} */ public function safeDown() { $this->dropForeignKey("ServicioElementoServicioFK", "ServicioElemento"); $this->dropTable('ServicioElemento'); $this->dropForeignKey("ServicioVehiculoFK", "Servicio"); $this->dropForeignKey("ServicioTallerFK", "Servicio"); $this->dropTable('Servicio'); } }