migrations/Version20220717121132.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 Version20220717121132 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 nursery_time_sheet (id INT AUTO_INCREMENT NOT NULL, establishment_id INT NOT NULL, school_year_id INT NOT NULL, registration_student_registration_id INT NOT NULL, create_date DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', created_by INT NOT NULL, updated_by INT NOT NULL, access VARCHAR(60) DEFAULT NULL, day VARCHAR(12) NOT NULL, month VARCHAR(10) NOT NULL, year VARCHAR(10) NOT NULL, INDEX IDX_E7B7B3208565851 (establishment_id), INDEX IDX_E7B7B320D2EECC3F (school_year_id), INDEX IDX_E7B7B320B0396129 (registration_student_registration_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE nursery_time_sheet ADD CONSTRAINT FK_E7B7B3208565851 FOREIGN KEY (establishment_id) REFERENCES establishment (id)');
  20.         $this->addSql('ALTER TABLE nursery_time_sheet ADD CONSTRAINT FK_E7B7B320D2EECC3F FOREIGN KEY (school_year_id) REFERENCES school_year (id)');
  21.         $this->addSql('ALTER TABLE nursery_time_sheet ADD CONSTRAINT FK_E7B7B320B0396129 FOREIGN KEY (registration_student_registration_id) REFERENCES registration_student_registration (id)');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->addSql('DROP TABLE nursery_time_sheet');
  27.     }
  28. }