migrations/Version20250522024104.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7. * Auto-generated Migration: Please modify to your needs!
  8. */
  9. final class Version20250522024104 extends AbstractMigration
  10. {
  11. public function getDescription(): string
  12. {
  13. return 'Create schedule log table';
  14. }
  15. public function up(Schema $schema): void
  16. {
  17. // this up() migration is auto-generated, please modify it to your needs
  18. $this->addSql(<<<'SQL'
  19. 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
  20. SQL);
  21. $this->addSql(<<<'SQL'
  22. ALTER TABLE dp_schedule_log ADD CONSTRAINT FK_B22799C69A98055D FOREIGN KEY (tcard_id) REFERENCES tc_tcard (id)
  23. SQL);
  24. }
  25. public function down(Schema $schema): void
  26. {
  27. // this down() migration is auto-generated, please modify it to your needs
  28. $this->addSql(<<<'SQL'
  29. ALTER TABLE dp_schedule_log DROP FOREIGN KEY FK_B22799C69A98055D
  30. SQL);
  31. $this->addSql(<<<'SQL'
  32. DROP TABLE dp_schedule_log
  33. SQL);
  34. }
  35. }