<?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 Version20210822141128 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 date_choix (id INT AUTO_INCREMENT NOT NULL, date VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE rndv (id INT AUTO_INCREMENT NOT NULL, date_id INT DEFAULT NULL, user_id INT DEFAULT NULL, heur VARCHAR(255) DEFAULT NULL, date_now DATETIME DEFAULT NULL, INDEX IDX_1ACC2B8BB897366B (date_id), INDEX IDX_1ACC2B8BA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE rndv ADD CONSTRAINT FK_1ACC2B8BB897366B FOREIGN KEY (date_id) REFERENCES date_choix (id)');
$this->addSql('ALTER TABLE rndv ADD CONSTRAINT FK_1ACC2B8BA76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE rndv DROP FOREIGN KEY FK_1ACC2B8BB897366B');
$this->addSql('DROP TABLE date_choix');
$this->addSql('DROP TABLE rndv');
}
}