migrations/Version20240427161500.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 Version20240427161500 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.         $sql = <<<SQL
  19.         -- Table: public.mostradocumento
  20.         -- DROP TABLE IF EXISTS public.mostradocumento;
  21.         CREATE TABLE IF NOT EXISTS public.mostradocumento
  22.         (
  23.             idmostra SERIAL,
  24.             iddocumento SERIAL,
  25.             CONSTRAINT mostradocumento_pkey PRIMARY KEY (idmostra, iddocumento),
  26.             CONSTRAINT mostradocumento_iddocumento_fkey FOREIGN KEY (iddocumento)
  27.                 REFERENCES public.articolo (id) MATCH SIMPLE
  28.                 ON UPDATE NO ACTION
  29.                 ON DELETE NO ACTION,
  30.             CONSTRAINT mostradocumento_idmostra_fkey FOREIGN KEY (idmostra)
  31.                 REFERENCES public.mostra (id) MATCH SIMPLE
  32.                 ON UPDATE NO ACTION
  33.                 ON DELETE NO ACTION
  34.         )
  35.         WITH (
  36.             OIDS = FALSE
  37.         )
  38.         TABLESPACE pg_default;
  39.         ALTER TABLE IF EXISTS public.mostradocumento
  40.             OWNER to ginocort_db_user;
  41.         GRANT ALL ON TABLE public.mostradocumento TO ginocort_db_user;
  42.         SQL;
  43.         $this->addSql($sql);
  44.         $sql = <<<SQL
  45.         -- Table: public.mostraarticolo
  46.         -- DROP TABLE IF EXISTS public.mostraarticolo;
  47.         CREATE TABLE IF NOT EXISTS public.mostraarticolo
  48.         (
  49.             idmostra SERIAL,
  50.             idarticolo SERIAL,
  51.             CONSTRAINT mostraarticolo_pkey PRIMARY KEY (idmostra, idarticolo),
  52.             CONSTRAINT mostraarticolo_idarticolo_fkey FOREIGN KEY (idarticolo)
  53.                 REFERENCES public.articolo (id) MATCH SIMPLE
  54.                 ON UPDATE NO ACTION
  55.                 ON DELETE NO ACTION,
  56.             CONSTRAINT mostraarticolo_idmostra_fkey FOREIGN KEY (idmostra)
  57.                 REFERENCES public.mostra (id) MATCH SIMPLE
  58.                 ON UPDATE NO ACTION
  59.                 ON DELETE NO ACTION
  60.         )
  61.         WITH (
  62.             OIDS = FALSE
  63.         )
  64.         TABLESPACE pg_default;
  65.         ALTER TABLE IF EXISTS public.mostraarticolo
  66.             OWNER to ginocort_db_user;
  67.         GRANT ALL ON TABLE public.mostraarticolo TO ginocort_db_user;
  68.         SQL;
  69.         $this->addSql($sql);
  70.     }
  71.     public function down(Schema $schema): void
  72.     {
  73.         // this down() migration is auto-generated, please modify it to your needs
  74.         $this->addSql('DROP TABLE mostraarticolo');
  75.         $this->addSql('DROP TABLE mostradocumento');
  76.     }
  77. }