<?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 Version20231227132800 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('ALTER TABLE documento ADD COLUMN pagina text');
$this->addSql('ALTER TABLE documento ADD COLUMN mese text');
$this->addSql("
CREATE TABLE operadocumento
(
idopera BIGINT,
iddocumento BIGINT,
CONSTRAINT operadocumento_pkey PRIMARY KEY (idopera, iddocumento),
CONSTRAINT operadocumento_iddocumento_fkey FOREIGN KEY (iddocumento)
REFERENCES public.documento (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT operadocumento_idopera_fkey FOREIGN KEY (idopera)
REFERENCES public.opera (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
");
$this->addSql('ALTER TABLE mostra ADD COLUMN presentazione text');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE documento DROP COLUMN pagina');
$this->addSql('ALTER TABLE documento DROP COLUMN mese');
$this->addSql('DROP TABLE operadocumento');
$this->addSql('ALTER TABLE mostra DROP COLUMN presentazione');
}
}