<?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 Version20230726204511 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 working_hour (id INT AUTO_INCREMENT NOT NULL, seller_id INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME DEFAULT NULL, day SMALLINT DEFAULT 1 NOT NULL, start TIME DEFAULT \'08:00:00\' NOT NULL, end TIME DEFAULT \'16:00:00\' NOT NULL, status SMALLINT DEFAULT 1 NOT NULL, INDEX IDX_2E64A3B48DE820D9 (seller_id), INDEX IDX_WORKING_HOUR_ID (id), UNIQUE INDEX UNQ_WORKING_HOUR_SELLER_ID_DAY (seller_id, day), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE working_hour ADD CONSTRAINT FK_2E64A3B48DE820D9 FOREIGN KEY (seller_id) REFERENCES seller (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE working_hour');
}
}