migrations/Version20231227132800.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20231227132800 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.        $this->addSql('ALTER TABLE documento ADD COLUMN pagina text');
  19.        $this->addSql('ALTER TABLE documento ADD COLUMN mese text');
  20.        $this->addSql("
  21.        CREATE TABLE operadocumento
  22.         (
  23.             idopera BIGINT,
  24.             iddocumento BIGINT,
  25.             CONSTRAINT operadocumento_pkey PRIMARY KEY (idopera, iddocumento),
  26.             CONSTRAINT operadocumento_iddocumento_fkey FOREIGN KEY (iddocumento)
  27.                 REFERENCES public.documento (id) MATCH SIMPLE
  28.                 ON UPDATE NO ACTION
  29.                 ON DELETE NO ACTION,
  30.             CONSTRAINT operadocumento_idopera_fkey FOREIGN KEY (idopera)
  31.                 REFERENCES public.opera (id) MATCH SIMPLE
  32.                 ON UPDATE NO ACTION
  33.                 ON DELETE NO ACTION
  34.         )
  35.        ");
  36.        $this->addSql('ALTER TABLE mostra ADD COLUMN presentazione text');
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.         $this->addSql('ALTER TABLE documento DROP COLUMN pagina');
  42.         $this->addSql('ALTER TABLE documento DROP COLUMN mese');
  43.         $this->addSql('DROP TABLE operadocumento');
  44.         $this->addSql('ALTER TABLE mostra DROP COLUMN presentazione');
  45.     }
  46. }