Files
MtoRagSystem/migrations/Version20260225000200.php
2026-02-26 07:02:07 +01:00

35 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260225000200 extends AbstractMigration
{
public function getDescription(): string
{
return 'Fix schema drift (indexes, FK, longtext nullability)';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE knowledge_tag CHANGE description description LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE knowledge_tag RENAME INDEX uniq_knowledge_tag_slug TO UNIQ_86B46255989D9B62');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY FK_D8698A769407EE77');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A769407EE77 FOREIGN KEY (current_version_id) REFERENCES document_version (id)');
$this->addSql('ALTER TABLE tag_rebuild_job CHANGE error_message error_message LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE document_tag RENAME INDEX idx_document_tag_document TO IDX_D0234567C33F7837');
$this->addSql('ALTER TABLE document_tag RENAME INDEX idx_document_tag_tag TO IDX_D0234567BAD26311');
}
public function down(Schema $schema): void
{
// Optional in Drift-Fix-Migration meist nicht notwendig
}
}