migrations/Version20220919091838.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 Version20220919091838 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 toast (id INT AUTO_INCREMENT NOT NULL, uid_id INT DEFAULT NULL, content LONGTEXT DEFAULT NULL, start_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', end_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_B35A6840534B549B (uid_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE toast ADD CONSTRAINT FK_B35A6840534B549B FOREIGN KEY (uid_id) REFERENCES uid (id)');
  20.         $this->addSql('ALTER TABLE lot DROP FOREIGN KEY FK_B81291BF5B7AF75');
  21.         $this->addSql('DROP INDEX UNIQ_B81291BF5B7AF75 ON lot');
  22.         $this->addSql('ALTER TABLE lot DROP address_id');
  23.         $this->addSql('ALTER TABLE operation ADD address_id INT DEFAULT NULL');
  24.         $this->addSql('ALTER TABLE operation ADD CONSTRAINT FK_1981A66DF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
  25.         $this->addSql('CREATE UNIQUE INDEX UNIQ_1981A66DF5B7AF75 ON operation (address_id)');
  26.         $this->addSql('ALTER TABLE profil_mo ADD function VARCHAR(255) DEFAULT NULL');
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // this down() migration is auto-generated, please modify it to your needs
  31.         $this->addSql('DROP TABLE toast');
  32.         $this->addSql('ALTER TABLE lot ADD address_id INT DEFAULT NULL');
  33.         $this->addSql('ALTER TABLE lot ADD CONSTRAINT FK_B81291BF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
  34.         $this->addSql('CREATE UNIQUE INDEX UNIQ_B81291BF5B7AF75 ON lot (address_id)');
  35.         $this->addSql('ALTER TABLE operation DROP FOREIGN KEY FK_1981A66DF5B7AF75');
  36.         $this->addSql('DROP INDEX UNIQ_1981A66DF5B7AF75 ON operation');
  37.         $this->addSql('ALTER TABLE operation DROP address_id');
  38.         $this->addSql('ALTER TABLE profil_mo DROP function');
  39.     }
  40. }