<?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 Version20220526144922 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 domande (id INT AUTO_INCREMENT NOT NULL, questionario_id INT NOT NULL, dipende_da_id INT DEFAULT NULL, domanda LONGTEXT NOT NULL, tipo_risposta LONGTEXT NOT NULL, opzioni_risposta LONGTEXT DEFAULT NULL, multipla TINYINT(1) NOT NULL, posizione INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_870FF4C3664E1225 (questionario_id), INDEX IDX_870FF4C32F574DCA (dipende_da_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE domande ADD CONSTRAINT FK_870FF4C3664E1225 FOREIGN KEY (questionario_id) REFERENCES questionari (id)');
$this->addSql('ALTER TABLE domande ADD CONSTRAINT FK_870FF4C32F574DCA FOREIGN KEY (dipende_da_id) REFERENCES domande (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE domande DROP FOREIGN KEY FK_870FF4C32F574DCA');
$this->addSql('DROP TABLE domande');
}
}