Internal: Set to null if document not exists from gradebook category

pull/5126/head
Angel Fernando Quiroz Campos 2 years ago
parent aa476d7ae2
commit 7631194800
  1. 1
      src/CoreBundle/Migrations/Schema/V200/Version20230405123419.php

@ -22,6 +22,7 @@ final class Version20230405123419 extends AbstractMigrationChamilo
);
}
if ($schema->hasTable('gradebook_category')) {
$this->addSql('UPDATE gradebook_category SET document_id = NULL WHERE document_id NOT IN (SELECT iid FROM c_document)');
$this->addSql(
'ALTER TABLE gradebook_category ADD CONSTRAINT FK_96A4C705C33F7837 FOREIGN KEY (document_id) REFERENCES c_document (iid) ON DELETE SET NULL;'
);

Loading…
Cancel
Save