migrations/Version20211212155019.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 Version20211212155019 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 meeting (id INT AUTO_INCREMENT NOT NULL, instance_id INT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, deleted_by_id INT DEFAULT NULL, saas_id INT DEFAULT NULL, description LONGTEXT DEFAULT NULL, is_all_day TINYINT(1) NOT NULL, createdAt DATETIME DEFAULT NULL, updatedAt DATETIME DEFAULT NULL, deletedAt DATETIME DEFAULT NULL, started_at DATE DEFAULT NULL, ended_at DATE DEFAULT NULL, INDEX IDX_F515E1393A51721D (instance_id), INDEX IDX_F515E139B03A8386 (created_by_id), INDEX IDX_F515E139896DBBDE (updated_by_id), INDEX IDX_F515E139C76F1F52 (deleted_by_id), INDEX IDX_F515E139C79C849A (saas_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE meeting ADD CONSTRAINT FK_F515E1393A51721D FOREIGN KEY (instance_id) REFERENCES instance (id)');
  20.         $this->addSql('ALTER TABLE meeting ADD CONSTRAINT FK_F515E139B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
  21.         $this->addSql('ALTER TABLE meeting ADD CONSTRAINT FK_F515E139896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
  22.         $this->addSql('ALTER TABLE meeting ADD CONSTRAINT FK_F515E139C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
  23.         $this->addSql('ALTER TABLE meeting ADD CONSTRAINT FK_F515E139C79C849A FOREIGN KEY (saas_id) REFERENCES saas (id) ON DELETE CASCADE');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('DROP TABLE meeting');
  29.     }
  30. }