<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240911150235 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE products_bundle__product_user (product_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', user_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_3D52B2D84584665A (product_id), INDEX IDX_3D52B2D8A76ED395 (user_id), PRIMARY KEY(product_id, user_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE products_bundle__product_user ADD CONSTRAINT FK_3D52B2D84584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE products_bundle__product_user ADD CONSTRAINT FK_3D52B2D8A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE products_bundle__product_user DROP FOREIGN KEY FK_3D52B2D84584665A');
$this->addSql('ALTER TABLE products_bundle__product_user DROP FOREIGN KEY FK_3D52B2D8A76ED395');
$this->addSql('DROP TABLE products_bundle__product_user');
}
}