migrations/Version20241021071129.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 Version20241021071129 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 ictus_etat_reclamation (id INT AUTO_INCREMENT NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE ictus_reclamation (id INT AUTO_INCREMENT NOT NULL, typereclamation_id INT NOT NULL, etatreclamation_id INT NOT NULL, user_id INT NOT NULL, commande_id INT DEFAULT NULL, mumeroticket INT DEFAULT NULL, description LONGTEXT NOT NULL, objet VARCHAR(255) NOT NULL, INDEX IDX_C5EF7923F2D655C2 (typereclamation_id), INDEX IDX_C5EF7923944FF781 (etatreclamation_id), INDEX IDX_C5EF7923A76ED395 (user_id), INDEX IDX_C5EF792382EA2E54 (commande_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE ictus_type_reclamation (id INT AUTO_INCREMENT NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('ALTER TABLE ictus_reclamation ADD CONSTRAINT FK_C5EF7923F2D655C2 FOREIGN KEY (typereclamation_id) REFERENCES ictus_type_reclamation (id)');
  22.         $this->addSql('ALTER TABLE ictus_reclamation ADD CONSTRAINT FK_C5EF7923944FF781 FOREIGN KEY (etatreclamation_id) REFERENCES ictus_etat_reclamation (id)');
  23.         $this->addSql('ALTER TABLE ictus_reclamation ADD CONSTRAINT FK_C5EF7923A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  24.         $this->addSql('ALTER TABLE ictus_reclamation ADD CONSTRAINT FK_C5EF792382EA2E54 FOREIGN KEY (commande_id) REFERENCES ictus_commande (id)');
  25.         $this->addSql('DROP TABLE mobile_produit');
  26.         $this->addSql('ALTER TABLE ictus_commande ADD raison_annulation LONGTEXT DEFAULT NULL, CHANGE reference reference INT NOT NULL');
  27.         $this->addSql('ALTER TABLE ictus_pharmacie ADD rcs VARCHAR(255) DEFAULT NULL');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('CREATE TABLE mobile_produit (id INT AUTO_INCREMENT NOT NULL, designation VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, code VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, photos VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  33.         $this->addSql('ALTER TABLE ictus_reclamation DROP FOREIGN KEY FK_C5EF7923F2D655C2');
  34.         $this->addSql('ALTER TABLE ictus_reclamation DROP FOREIGN KEY FK_C5EF7923944FF781');
  35.         $this->addSql('ALTER TABLE ictus_reclamation DROP FOREIGN KEY FK_C5EF7923A76ED395');
  36.         $this->addSql('ALTER TABLE ictus_reclamation DROP FOREIGN KEY FK_C5EF792382EA2E54');
  37.         $this->addSql('DROP TABLE ictus_etat_reclamation');
  38.         $this->addSql('DROP TABLE ictus_reclamation');
  39.         $this->addSql('DROP TABLE ictus_type_reclamation');
  40.         $this->addSql('ALTER TABLE ictus_pharmacie DROP rcs');
  41.         $this->addSql('ALTER TABLE ictus_commande DROP raison_annulation, CHANGE reference reference VARCHAR(255) NOT NULL');
  42.     }
  43. }