<?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 Version20230601125347 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 speed_dating_job_company (id INT AUTO_INCREMENT NOT NULL, address_id INT DEFAULT NULL, profile_picture_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL, url VARCHAR(300) NOT NULL, created_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_22489A9DF5B7AF75 (address_id), UNIQUE INDEX UNIQ_22489A9D292E8AE2 (profile_picture_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE speed_dating_job_company_job_mapping (speed_dating_job_company_id INT NOT NULL, job_id INT NOT NULL, INDEX IDX_6516EEBC60234583 (speed_dating_job_company_id), INDEX IDX_6516EEBCBE04EA9 (job_id), PRIMARY KEY(speed_dating_job_company_id, job_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE speed_dating_job_contact (id INT AUTO_INCREMENT NOT NULL, speed_dating_job_company_id INT DEFAULT NULL, firstname VARCHAR(191) NOT NULL, lastname VARCHAR(191) NOT NULL, email VARCHAR(191) NOT NULL, phone VARCHAR(191) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_219575EA60234583 (speed_dating_job_company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE speed_dating_job_company ADD CONSTRAINT FK_22489A9DF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id)');
$this->addSql('ALTER TABLE speed_dating_job_company ADD CONSTRAINT FK_22489A9D292E8AE2 FOREIGN KEY (profile_picture_id) REFERENCES media__media (id)');
$this->addSql('ALTER TABLE speed_dating_job_company_job_mapping ADD CONSTRAINT FK_6516EEBC60234583 FOREIGN KEY (speed_dating_job_company_id) REFERENCES speed_dating_job_company (id)');
$this->addSql('ALTER TABLE speed_dating_job_company_job_mapping ADD CONSTRAINT FK_6516EEBCBE04EA9 FOREIGN KEY (job_id) REFERENCES job (id)');
$this->addSql('ALTER TABLE speed_dating_job_contact ADD CONSTRAINT FK_219575EA60234583 FOREIGN KEY (speed_dating_job_company_id) REFERENCES speed_dating_job_company (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE speed_dating_job_company DROP FOREIGN KEY FK_22489A9DF5B7AF75');
$this->addSql('ALTER TABLE speed_dating_job_company DROP FOREIGN KEY FK_22489A9D292E8AE2');
$this->addSql('ALTER TABLE speed_dating_job_company_job_mapping DROP FOREIGN KEY FK_6516EEBC60234583');
$this->addSql('ALTER TABLE speed_dating_job_company_job_mapping DROP FOREIGN KEY FK_6516EEBCBE04EA9');
$this->addSql('ALTER TABLE speed_dating_job_contact DROP FOREIGN KEY FK_219575EA60234583');
$this->addSql('DROP TABLE speed_dating_job_company');
$this->addSql('DROP TABLE speed_dating_job_company_job_mapping');
$this->addSql('DROP TABLE speed_dating_job_contact');
}
}