migrations\Version20210712115206.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 Version20210712115206 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 reservation_alert (id INT AUTO_INCREMENT NOT NULL, resolved_by_id INT DEFAULT NULL, parking_slot_id INT DEFAULT NULL, type VARCHAR(40) NOT NULL, is_resolved TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_548296666713A32B (resolved_by_id), INDEX IDX_54829666D70FE946 (parking_slot_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE reservation_alert ADD CONSTRAINT FK_548296666713A32B FOREIGN KEY (resolved_by_id) REFERENCES user (id)');
  20.         $this->addSql('ALTER TABLE reservation_alert ADD CONSTRAINT FK_54829666D70FE946 FOREIGN KEY (parking_slot_id) REFERENCES parkingslot (id)');
  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 reservation_alert');
  26.     }
  27. }