<?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 Version20220901131650 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 client_sewing (client_id INT NOT NULL, sewing_id INT NOT NULL, INDEX IDX_A146B71A19EB6921 (client_id), INDEX IDX_A146B71AA8EBEFE2 (sewing_id), PRIMARY KEY(client_id, sewing_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE client_sewing ADD CONSTRAINT FK_A146B71A19EB6921 FOREIGN KEY (client_id) REFERENCES client (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE client_sewing ADD CONSTRAINT FK_A146B71AA8EBEFE2 FOREIGN KEY (sewing_id) REFERENCES sewing (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE client_sewing');
}
}