migrations/Version20210502105922.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20210502105922 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE trial (id INT AUTO_INCREMENT NOT NULL, project_id INT NOT NULL, trial_date DATETIME DEFAULT NULL, observations VARCHAR(255) DEFAULT NULL, humidity NUMERIC(5, 2) DEFAULT NULL, primary_packaging_type VARCHAR(50) DEFAULT NULL, primary_packaging_weight NUMERIC(10, 4) DEFAULT NULL, secondary_packaging_type VARCHAR(50) DEFAULT NULL, secondary_packaging_weight NUMERIC(10, 4) DEFAULT NULL, plaston_area_o VARCHAR(15) DEFAULT NULL, plaston_area_r VARCHAR(15) DEFAULT NULL, plaston_largo_o VARCHAR(15) DEFAULT NULL, plaston_largo_r VARCHAR(15) DEFAULT NULL, plaston_ancho_o VARCHAR(15) DEFAULT NULL, plaston_ancho_r VARCHAR(15) DEFAULT NULL, plaston_alto_o VARCHAR(15) DEFAULT NULL, plaston_alto_r VARCHAR(15) DEFAULT NULL, galleta_area_o VARCHAR(15) DEFAULT NULL, galleta_area_r VARCHAR(15) DEFAULT NULL, galleta_largo_o VARCHAR(15) DEFAULT NULL, galleta_largo_r VARCHAR(15) DEFAULT NULL, galleta_ancho_o VARCHAR(15) DEFAULT NULL, galleta_ancho_r VARCHAR(15) DEFAULT NULL, galleta_alto_o VARCHAR(15) DEFAULT NULL, galleta_alto_r VARCHAR(15) DEFAULT NULL, plaston_superficio_o VARCHAR(15) DEFAULT NULL, plaston_superficie_r VARCHAR(15) DEFAULT NULL, plaston_perdida_o VARCHAR(15) DEFAULT NULL, plaston_perdida_r VARCHAR(15) DEFAULT NULL, crudo_diametro_o VARCHAR(15) DEFAULT NULL, crudo_diametro_r VARCHAR(15) DEFAULT NULL, crudo_largo_o VARCHAR(15) DEFAULT NULL, crudo_largo_r VARCHAR(15) DEFAULT NULL, crudo_ancho_o VARCHAR(15) DEFAULT NULL, crudo_ancho_r VARCHAR(15) DEFAULT NULL, crudo_alto_r VARCHAR(15) DEFAULT NULL, crudo_alto_o VARCHAR(15) DEFAULT NULL, horneado_diametro_o VARCHAR(15) DEFAULT NULL, horneado_diametro_r VARCHAR(15) DEFAULT NULL, horneado_largo_o VARCHAR(15) DEFAULT NULL, horneado_largo_r VARCHAR(15) DEFAULT NULL, horneado_ancho_o VARCHAR(15) DEFAULT NULL, horneado_ancho_r VARCHAR(15) DEFAULT NULL, horneado_alto_o VARCHAR(15) DEFAULT NULL, horneado_alto_r VARCHAR(15) DEFAULT NULL, desarrollo_diametro_o VARCHAR(15) DEFAULT NULL, desarrollo_diametro_r VARCHAR(15) DEFAULT NULL, desarrollo_largo_o VARCHAR(15) DEFAULT NULL, desarrollo_largo_r VARCHAR(15) DEFAULT NULL, desarrollo_ancho_o VARCHAR(15) DEFAULT NULL, desarrollo_ancho_r VARCHAR(15) DEFAULT NULL, desarrollo_alto_o VARCHAR(15) DEFAULT NULL, desarrollo_alto_r VARCHAR(15) DEFAULT NULL, INDEX IDX_74A25E3F166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE trial ADD CONSTRAINT FK_74A25E3F166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)');
  20.         $this->addSql('ALTER TABLE recipe_test CHANGE state state INT NOT NULL');
  21.     }
  22.     public function down(Schema $schema) : void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('DROP TABLE trial');
  26.         $this->addSql('ALTER TABLE recipe_test CHANGE state state INT DEFAULT 0 NOT NULL');
  27.     }
  28. }