<?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 Version20220729153725 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_widget_user (widget_id UUID NOT NULL, widget_user_id UUID NOT NULL, PRIMARY KEY(widget_id, widget_user_id))');
$this->addSql('CREATE INDEX IDX_2B7E577AFBE885E2 ON widget_widget_user (widget_id)');
$this->addSql('CREATE INDEX IDX_2B7E577AA941D454 ON widget_widget_user (widget_user_id)');
$this->addSql('COMMENT ON COLUMN widget_widget_user.widget_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN widget_widget_user.widget_user_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE widget_widget_user ADD CONSTRAINT FK_2B7E577AFBE885E2 FOREIGN KEY (widget_id) REFERENCES widget (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE widget_widget_user ADD CONSTRAINT FK_2B7E577AA941D454 FOREIGN KEY (widget_user_id) REFERENCES widget_user (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE widget ALTER logotype_link DROP NOT NULL');
}
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_widget_user');
$this->addSql('ALTER TABLE widget ALTER logotype_link SET NOT NULL');
}
}