migrations\Version20220128085154.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 Version20220128085154 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 parking_slot_history (id INT AUTO_INCREMENT NOT NULL, parking_slot_id INT NOT NULL, parking_type_id INT DEFAULT NULL, parking_map_id INT NOT NULL, company_id INT DEFAULT NULL, code VARCHAR(32) DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, is_active TINYINT(1) NOT NULL, INDEX IDX_485EABECD70FE946 (parking_slot_id), INDEX IDX_485EABEC4BA67449 (parking_type_id), INDEX IDX_485EABEC7D27CF9 (parking_map_id), INDEX IDX_485EABEC979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE parking_slot_history ADD CONSTRAINT FK_485EABECD70FE946 FOREIGN KEY (parking_slot_id) REFERENCES parkingslot (id)');
  20.         $this->addSql('ALTER TABLE parking_slot_history ADD CONSTRAINT FK_485EABEC4BA67449 FOREIGN KEY (parking_type_id) REFERENCES parkingtype (id)');
  21.         $this->addSql('ALTER TABLE parking_slot_history ADD CONSTRAINT FK_485EABEC7D27CF9 FOREIGN KEY (parking_map_id) REFERENCES parkingmap (id)');
  22.         $this->addSql('ALTER TABLE parking_slot_history ADD CONSTRAINT FK_485EABEC979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)');
  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('DROP TABLE parking_slot_history');
  28.     }
  29. }