<?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 Version20230429083744 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 exercise_simple_answer_result (id INT AUTO_INCREMENT NOT NULL, patient_id INT NOT NULL, exercise_id INT NOT NULL, answer VARCHAR(255) NOT NULL, played_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', kpi_evaluation DOUBLE PRECISION DEFAULT NULL, INDEX IDX_DD2276066B899279 (patient_id), INDEX IDX_DD227606E934951A (exercise_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE patient (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(32) DEFAULT NULL, surname VARCHAR(32) DEFAULT NULL, alexa_id LONGTEXT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE exercise_simple_answer_result ADD CONSTRAINT FK_DD2276066B899279 FOREIGN KEY (patient_id) REFERENCES patient (id)');
$this->addSql('ALTER TABLE exercise_simple_answer_result ADD CONSTRAINT FK_DD227606E934951A FOREIGN KEY (exercise_id) REFERENCES exercise_simple_answer (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE exercise_simple_answer_result DROP FOREIGN KEY FK_DD2276066B899279');
$this->addSql('DROP TABLE exercise_simple_answer_result');
$this->addSql('DROP TABLE patient');
}
}