<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230411085244 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$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');
$this->addSql('ALTER TABLE course_proposal ADD CONSTRAINT FK_1651F924591CC992 FOREIGN KEY (course_id) REFERENCES course (id)');
$this->addSql('ALTER TABLE course_proposal ADD CONSTRAINT FK_1651F924FD128646 FOREIGN KEY (delivery_man_id) REFERENCES delivery_man (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE course_proposal DROP FOREIGN KEY FK_1651F924591CC992');
$this->addSql('ALTER TABLE course_proposal DROP FOREIGN KEY FK_1651F924FD128646');
$this->addSql('DROP TABLE course_proposal');
}
}