<?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 Version20231111143227 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('DROP TABLE sds_questionnaire');
$this->addSql('ALTER TABLE patient ADD sds_questionnaire_mark INT DEFAULT NULL, ADD sds_quesstionnaire_created_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE sds_questionnaire (id INT AUTO_INCREMENT NOT NULL, patient_id INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', mark INT NOT NULL, UNIQUE INDEX UNIQ_7DDD61D96B899279 (patient_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE sds_questionnaire ADD CONSTRAINT FK_7DDD61D96B899279 FOREIGN KEY (patient_id) REFERENCES patient (id)');
$this->addSql('ALTER TABLE patient DROP sds_questionnaire_mark, DROP sds_quesstionnaire_created_at');
}
}