<?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 Version20220914123815 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 job_material (id INT AUTO_INCREMENT NOT NULL, material_id INT DEFAULT NULL, job_id INT DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_1BF9D0EEE308AC6F (material_id), INDEX IDX_1BF9D0EEBE04EA9 (job_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE job_material ADD CONSTRAINT FK_1BF9D0EEE308AC6F FOREIGN KEY (material_id) REFERENCES material (id)');
$this->addSql('ALTER TABLE job_material ADD CONSTRAINT FK_1BF9D0EEBE04EA9 FOREIGN KEY (job_id) REFERENCES job (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE job_material DROP FOREIGN KEY FK_1BF9D0EEBE04EA9');
$this->addSql('ALTER TABLE job_material DROP FOREIGN KEY FK_1BF9D0EEE308AC6F');
$this->addSql('DROP TABLE job_material');
}
}