<?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 Version20210223173222 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 cal_calendar_event (id INT AUTO_INCREMENT NOT NULL, calendar_id INT NOT NULL, type VARCHAR(50) DEFAULT NULL, google_id VARCHAR(255) DEFAULT NULL, `from` DATETIME NOT NULL, `to` DATETIME NOT NULL, INDEX IDX_5C264FDCA40A2C8 (calendar_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE cal_calendar_timeslot (id INT AUTO_INCREMENT NOT NULL, calendar_id INT NOT NULL, day SMALLINT NOT NULL, from_time TIME NOT NULL, to_time TIME NOT NULL, INDEX IDX_D2D6573A40A2C8 (calendar_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE cal_calendar_event ADD CONSTRAINT FK_5C264FDCA40A2C8 FOREIGN KEY (calendar_id) REFERENCES cal_calendar (id)');
$this->addSql('ALTER TABLE cal_calendar_timeslot ADD CONSTRAINT FK_D2D6573A40A2C8 FOREIGN KEY (calendar_id) REFERENCES cal_calendar (id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE cal_calendar_event');
$this->addSql('DROP TABLE cal_calendar_timeslot');
}
}