fix db delete data issue
Tests / PHPUnit (push) Failing after 1m24s

This commit is contained in:
root
2026-07-13 01:43:32 -04:00
parent f3ac521d7c
commit 504c3bc9f9
12 changed files with 76 additions and 154 deletions
@@ -169,28 +169,9 @@ class FixSchoolYearColumns extends Migration
$this->db->resetDataCache();
// Remove redundant columns. Dependent non-primary indexes are removed first.
foreach ($this->tablesWithoutDirectYear as $table) {
if (! $this->db->tableExists($table) || ! $this->db->fieldExists('school_year', $table)) {
continue;
}
$this->dropIndexesContainingColumn($table, 'school_year');
$this->dropChecksContainingColumn($table, 'school_year');
$this->forge->dropColumn($table, 'school_year');
$this->db->resetDataCache();
}
foreach ($this->tablesWithoutDirectSemester as $table) {
if (! $this->db->tableExists($table) || ! $this->db->fieldExists('semester', $table)) {
continue;
}
$this->dropIndexesContainingColumn($table, 'semester');
$this->dropChecksContainingColumn($table, 'semester');
$this->forge->dropColumn($table, 'semester');
$this->db->resetDataCache();
}
// Do not drop redundant school_year/semester columns here. Restored
// production dumps may still contain meaningful historical data in
// those columns, and running migrate must not destroy it.
$this->db->resetDataCache();