<?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 Version20250522024104 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create schedule log table';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
CREATE TABLE dp_schedule_log (id INT AUTO_INCREMENT NOT NULL, tcard_id INT DEFAULT NULL, schedule_date DATETIME NOT NULL, schedule_status TINYINT(1) DEFAULT 1 NOT NULL, schedule_event_id VARCHAR(255) DEFAULT NULL, schedule_data LONGTEXT NOT NULL, created_time DATETIME NOT NULL, INDEX tcard_id_idx (tcard_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE dp_schedule_log ADD CONSTRAINT FK_B22799C69A98055D FOREIGN KEY (tcard_id) REFERENCES tc_tcard (id)
SQL);
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql(<<<'SQL'
ALTER TABLE dp_schedule_log DROP FOREIGN KEY FK_B22799C69A98055D
SQL);
$this->addSql(<<<'SQL'
DROP TABLE dp_schedule_log
SQL);
}
}