harden document delete and rebuild faiss index
This commit is contained in:
39
migrations/Version20260217135550.php
Normal file
39
migrations/Version20260217135550.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user