File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
3
use Illuminate \Database \Migrations \Migration ;
4
- use Illuminate \Database \Schema \Blueprint ;
5
- use Illuminate \Support \Facades \Schema ;
6
4
use Illuminate \Support \Facades \DB ;
7
5
use Illuminate \Support \Facades \Log ;
8
6
@@ -31,7 +29,7 @@ public function replaceModels($table_name)
31
29
// if you've ended up with duplicate entries (both for App\User and App\Models\BackpackUser)
32
30
// we can just delete them
33
31
$ userEntries = DB ::table ($ table_name )
34
- ->where (" model_type " , "App\User " )
32
+ ->where (' model_type ' , "App\User " )
35
33
->get ();
36
34
37
35
foreach ($ userEntries as $ entry ) {
@@ -44,9 +42,9 @@ public function replaceModels($table_name)
44
42
45
43
// for the rest of them, we can just replace the BackpackUser model with User
46
44
DB ::table ($ table_name )
47
- ->where (" model_type " , "App\Models\BackpackUser " )
45
+ ->where (' model_type ' , "App\Models\BackpackUser " )
48
46
->update ([
49
- " model_type " => "App\User "
47
+ ' model_type ' => "App\User " ,
50
48
]);
51
49
}
52
50
}
You can’t perform that action at this time.
0 commit comments