<?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 Version20220606143237 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 risposte (id INT AUTO_INCREMENT NOT NULL, questionario_id INT NOT NULL, questionario_iniziato_id INT NOT NULL, domanda_id INT NOT NULL, tipo_risposta LONGTEXT DEFAULT NULL, opzioni_risposta LONGTEXT DEFAULT NULL, multipla TINYINT(1) NOT NULL, posizione INT NOT NULL, risposta LONGTEXT NOT NULL, obbligatoria TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', modified_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_A264C76B664E1225 (questionario_id), INDEX IDX_A264C76B2B8B45A8 (questionario_iniziato_id), INDEX IDX_A264C76B9AA543D1 (domanda_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE risposte ADD CONSTRAINT FK_A264C76B664E1225 FOREIGN KEY (questionario_id) REFERENCES questionari (id)');
$this->addSql('ALTER TABLE risposte ADD CONSTRAINT FK_A264C76B2B8B45A8 FOREIGN KEY (questionario_iniziato_id) REFERENCES questionari_iniziati (id)');
$this->addSql('ALTER TABLE risposte ADD CONSTRAINT FK_A264C76B9AA543D1 FOREIGN KEY (domanda_id) REFERENCES domande (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE risposte');
}
}