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:
@@ -30,6 +30,16 @@ class RevertPrintRequestsForeignKey extends Migration
|
||||
return;
|
||||
}
|
||||
|
||||
$orphanCount = (int) $db->table('print_requests pr')
|
||||
->join('classes c', 'c.id = pr.class_id', 'left')
|
||||
->where('pr.class_id IS NOT NULL', null, false)
|
||||
->where('c.id IS NULL', null, false)
|
||||
->countAllResults();
|
||||
|
||||
if ($orphanCount > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add the new foreign key
|
||||
$this->forge->addForeignKey('class_id', 'classes', 'id', 'CASCADE', 'CASCADE');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user