@@ -11,6 +11,10 @@ class FixPrintRequestsForeignKey extends Migration
|
||||
// Drop the old foreign key if it exists
|
||||
$this->forge->dropForeignKey('print_requests', 'print_requests_class_id_foreign');
|
||||
|
||||
if (! $this->db->tableExists('class_sections')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add the new foreign key
|
||||
$this->forge->addForeignKey('class_id', 'class_sections', 'id', 'CASCADE', 'CASCADE');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user