<?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 Version20220415094827 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 widget_user_widget (widget_user_id UUID NOT NULL, widget_id UUID NOT NULL, PRIMARY KEY(widget_user_id, widget_id))');
$this->addSql('CREATE INDEX IDX_DEB18F61A941D454 ON widget_user_widget (widget_user_id)');
$this->addSql('CREATE INDEX IDX_DEB18F61FBE885E2 ON widget_user_widget (widget_id)');
$this->addSql('COMMENT ON COLUMN widget_user_widget.widget_user_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN widget_user_widget.widget_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE widget_user_widget ADD CONSTRAINT FK_DEB18F61A941D454 FOREIGN KEY (widget_user_id) REFERENCES widget_user (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE widget_user_widget ADD CONSTRAINT FK_DEB18F61FBE885E2 FOREIGN KEY (widget_id) REFERENCES widget (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP TABLE widget_user_widget');
}
}