<?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 Version20230621072008 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 move_history (id INT AUTO_INCREMENT NOT NULL, from_order_id VARCHAR(255) DEFAULT NULL, to_ticket_id INT DEFAULT NULL, moved_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_D577B61CCB708DA2 (from_order_id), INDEX IDX_D577B61C41A390A3 (to_ticket_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE move_history ADD CONSTRAINT FK_D577B61CCB708DA2 FOREIGN KEY (from_order_id) REFERENCES `order` (id)');
$this->addSql('ALTER TABLE move_history ADD CONSTRAINT FK_D577B61C41A390A3 FOREIGN KEY (to_ticket_id) REFERENCES ticket (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE move_history DROP FOREIGN KEY FK_D577B61CCB708DA2');
$this->addSql('ALTER TABLE move_history DROP FOREIGN KEY FK_D577B61C41A390A3');
$this->addSql('DROP TABLE move_history');
}
}