<?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 Version20220505100734 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 bin (id INT AUTO_INCREMENT NOT NULL, columns_id INT DEFAULT NULL, bin VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, INDEX IDX_AA275AED117615F0 (columns_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE `column` (id INT AUTO_INCREMENT NOT NULL, work_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, start TIME NOT NULL, stop TIME NOT NULL, INDEX IDX_7D53877EBB3453DB (work_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE work_space (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, INDEX IDX_189BA15A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE bin ADD CONSTRAINT FK_AA275AED117615F0 FOREIGN KEY (columns_id) REFERENCES `column` (id)');
$this->addSql('ALTER TABLE `column` ADD CONSTRAINT FK_7D53877EBB3453DB FOREIGN KEY (work_id) REFERENCES work_space (id)');
$this->addSql('ALTER TABLE work_space ADD CONSTRAINT FK_189BA15A76ED395 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 bin DROP FOREIGN KEY FK_AA275AED117615F0');
$this->addSql('ALTER TABLE `column` DROP FOREIGN KEY FK_7D53877EBB3453DB');
$this->addSql('DROP TABLE bin');
$this->addSql('DROP TABLE `column`');
$this->addSql('DROP TABLE work_space');
}
}