<?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 Version20230129232704 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 booking (id INT AUTO_INCREMENT NOT NULL, booking_room_id INT NOT NULL, user_id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, booking_status VARCHAR(255) DEFAULT NULL, booking_date DATETIME NOT NULL, creation_date DATETIME NOT NULL, comments LONGTEXT DEFAULT NULL, INDEX IDX_E00CEDDEEA935B3 (booking_room_id), INDEX IDX_E00CEDDEA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE booking_room (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description_text LONGTEXT DEFAULT NULL, equipment LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDEEA935B3 FOREIGN KEY (booking_room_id) REFERENCES booking_room (id)');
$this->addSql('ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDEA76ED395 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 booking DROP FOREIGN KEY FK_E00CEDDEEA935B3');
$this->addSql('DROP TABLE booking');
$this->addSql('DROP TABLE booking_room');
}
}