migrations/Version20230411085244.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 Version20230411085244 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 course_proposal (id INT AUTO_INCREMENT NOT NULL, course_id INT NOT NULL, delivery_man_id INT NOT NULL, proposed_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', accepted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', refused_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_1651F924591CC992 (course_id), INDEX IDX_1651F924FD128646 (delivery_man_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19. $this->addSql('ALTER TABLE course_proposal ADD CONSTRAINT FK_1651F924591CC992 FOREIGN KEY (course_id) REFERENCES course (id)');
  20. $this->addSql('ALTER TABLE course_proposal ADD CONSTRAINT FK_1651F924FD128646 FOREIGN KEY (delivery_man_id) REFERENCES delivery_man (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('ALTER TABLE course_proposal DROP FOREIGN KEY FK_1651F924591CC992');
  26. $this->addSql('ALTER TABLE course_proposal DROP FOREIGN KEY FK_1651F924FD128646');
  27. $this->addSql('DROP TABLE course_proposal');
  28. }
  29. }