fix enrollment logic, add financial aid, fix class distribution
Tests / PHPUnit (push) Failing after 1m6s
Tests / PHPUnit (push) Failing after 1m6s
This commit is contained in:
@@ -29,6 +29,16 @@ class FixPrintRequestsForeignKeyOnceAndForAll extends Migration
|
||||
return;
|
||||
}
|
||||
|
||||
$orphanCount = (int) $db->table('print_requests pr')
|
||||
->join('classSection cs', 'cs.id = pr.class_id', 'left')
|
||||
->where('pr.class_id IS NOT NULL', null, false)
|
||||
->where('cs.id IS NULL', null, false)
|
||||
->countAllResults();
|
||||
|
||||
if ($orphanCount > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->forge->addForeignKey('class_id', 'classSection', 'id', 'CASCADE', 'CASCADE');
|
||||
$this->forge->processIndexes('print_requests');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user