harden document delete and rebuild faiss index

This commit is contained in:
team 1
2026-02-17 14:59:56 +01:00
parent fcd9488a18
commit 47ae0232de
3 changed files with 52 additions and 24 deletions

View File

@@ -0,0 +1,39 @@
<?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 Version20260217135550 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('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) ON DELETE SET NULL');
$this->addSql('ALTER TABLE document_version DROP FOREIGN KEY `FK_1B73751FC33F7837`');
$this->addSql('ALTER TABLE document_version ADD CONSTRAINT FK_1B73751FC33F7837 FOREIGN KEY (document_id) REFERENCES document (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE ingest_profile CHANGE id id BINARY(16) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$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 document_version DROP FOREIGN KEY FK_1B73751FC33F7837');
$this->addSql('ALTER TABLE document_version ADD CONSTRAINT `FK_1B73751FC33F7837` FOREIGN KEY (document_id) REFERENCES document (id)');
$this->addSql('ALTER TABLE ingest_profile CHANGE id id VARBINARY(16) NOT NULL');
}
}