migrations/Version20210721135353.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 Version20210721135353 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('DROP TABLE projet_etiquettes');
  19.         $this->addSql('DROP TABLE type_facturation');
  20.         $this->addSql('ALTER TABLE demande_client_commentaire CHANGE date date DATETIME DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE devis ADD date_accept DATETIME DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE projet_commentaires CHANGE date date DATETIME DEFAULT NULL');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('CREATE TABLE projet_etiquettes (id INT AUTO_INCREMENT NOT NULL, projet INT DEFAULT NULL, name VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, color VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, INDEX IDX_113391D250159CA9 (projet), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  28.         $this->addSql('CREATE TABLE type_facturation (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(20) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, taux_horaire INT DEFAULT NULL, `default` TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  29.         $this->addSql('ALTER TABLE projet_etiquettes ADD CONSTRAINT FK_113391D250159CA9 FOREIGN KEY (projet) REFERENCES projets (id) ON DELETE CASCADE');
  30.         $this->addSql('ALTER TABLE demande_client_commentaire CHANGE date date DATETIME DEFAULT NULL');
  31.         $this->addSql('ALTER TABLE devis DROP date_accept');
  32.         $this->addSql('ALTER TABLE projet_commentaires CHANGE date date DATETIME DEFAULT NULL');
  33.     }
  34. }