migrations/Version20220916161437.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 Version20220916161437 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('ALTER TABLE reisekosten DROP FOREIGN KEY FK_10355462A40A2C8');
  19.         $this->addSql('DROP TABLE reisekosten');
  20.         $this->addSql('ALTER TABLE calendar ADD itinerary VARCHAR(255) DEFAULT NULL, ADD km DOUBLE PRECISION DEFAULT 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('CREATE TABLE reisekosten (id INT AUTO_INCREMENT NOT NULL, calendar_id INT DEFAULT NULL, itinerary VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, purpose LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, km DOUBLE PRECISION DEFAULT NULL, UNIQUE INDEX UNIQ_10355462A40A2C8 (calendar_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  26.         $this->addSql('ALTER TABLE reisekosten ADD CONSTRAINT FK_10355462A40A2C8 FOREIGN KEY (calendar_id) REFERENCES calendar (id)');
  27.         $this->addSql('ALTER TABLE calendar DROP itinerary, DROP km');
  28.     }
  29. }