fix tests issues
Tests / PHPUnit (push) Failing after 1m16s

This commit is contained in:
root
2026-07-13 00:24:00 -04:00
parent 439a695727
commit a56aca4342
17 changed files with 349 additions and 40 deletions
@@ -122,6 +122,8 @@ class FixSchoolYearColumns extends Migration
);
}
$this->db->resetDataCache();
// These annual entities lacked a school_year column in the audited schema.
foreach (['class_progress_reports', 'exams', 'print_requests'] as $table) {
if ($this->db->tableExists($table) && ! $this->db->fieldExists('school_year', $table)) {
@@ -137,6 +139,8 @@ class FixSchoolYearColumns extends Migration
}
}
$this->db->resetDataCache();
// Validate and normalize every direct owner to VARCHAR(9).
foreach ($this->yearOwnerTables as $table) {
if (! $this->db->tableExists($table) || ! $this->db->fieldExists('school_year', $table)) {
@@ -163,6 +167,8 @@ 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)) {
@@ -172,6 +178,7 @@ class FixSchoolYearColumns extends Migration
$this->dropIndexesContainingColumn($table, 'school_year');
$this->dropChecksContainingColumn($table, 'school_year');
$this->forge->dropColumn($table, 'school_year');
$this->db->resetDataCache();
}
foreach ($this->tablesWithoutDirectSemester as $table) {
@@ -182,8 +189,11 @@ class FixSchoolYearColumns extends Migration
$this->dropIndexesContainingColumn($table, 'semester');
$this->dropChecksContainingColumn($table, 'semester');
$this->forge->dropColumn($table, 'semester');
$this->db->resetDataCache();
}
$this->db->resetDataCache();
foreach ($this->yearOwnerTables as $table) {
if (! $this->db->tableExists($table) || ! $this->db->fieldExists('school_year', $table)) {
continue;