<?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 Version20240427161500 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
$sql = <<<SQL
-- Table: public.mostradocumento
-- DROP TABLE IF EXISTS public.mostradocumento;
CREATE TABLE IF NOT EXISTS public.mostradocumento
(
idmostra SERIAL,
iddocumento SERIAL,
CONSTRAINT mostradocumento_pkey PRIMARY KEY (idmostra, iddocumento),
CONSTRAINT mostradocumento_iddocumento_fkey FOREIGN KEY (iddocumento)
REFERENCES public.articolo (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT mostradocumento_idmostra_fkey FOREIGN KEY (idmostra)
REFERENCES public.mostra (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.mostradocumento
OWNER to ginocort_db_user;
GRANT ALL ON TABLE public.mostradocumento TO ginocort_db_user;
SQL;
$this->addSql($sql);
$sql = <<<SQL
-- Table: public.mostraarticolo
-- DROP TABLE IF EXISTS public.mostraarticolo;
CREATE TABLE IF NOT EXISTS public.mostraarticolo
(
idmostra SERIAL,
idarticolo SERIAL,
CONSTRAINT mostraarticolo_pkey PRIMARY KEY (idmostra, idarticolo),
CONSTRAINT mostraarticolo_idarticolo_fkey FOREIGN KEY (idarticolo)
REFERENCES public.articolo (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT mostraarticolo_idmostra_fkey FOREIGN KEY (idmostra)
REFERENCES public.mostra (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.mostraarticolo
OWNER to ginocort_db_user;
GRANT ALL ON TABLE public.mostraarticolo TO ginocort_db_user;
SQL;
$this->addSql($sql);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE mostraarticolo');
$this->addSql('DROP TABLE mostradocumento');
}
}