File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 1212use FamilyTree365 \LaravelGedcom \Utils \Importer \Sour ;
1313use FamilyTree365 \LaravelGedcom \Utils \Importer \Subm ;
1414use FamilyTree365 \LaravelGedcom \Utils \Importer \Subn ;
15+ use Gedcom \Parser ;
1516use Illuminate \Console \OutputStyle ;
1617use Illuminate \Support \Facades \Log ;
17- use Gedcom \Parser ;
1818use Symfony \Component \Console \Input \StringInput ;
1919use Symfony \Component \Console \Output \StreamOutput ;
2020
Original file line number Diff line number Diff line change 1111use FamilyTree365 \LaravelGedcom \Models \Source ;
1212use FamilyTree365 \LaravelGedcom \Models \Subm ;
1313use FamilyTree365 \LaravelGedcom \Models \Subn ;
14- use Illuminate \Console \OutputStyle ;
1514use Gedcom \Parser ;
15+ use Illuminate \Console \OutputStyle ;
1616use Symfony \Component \Console \Input \StringInput ;
1717use Symfony \Component \Console \Output \StreamOutput ;
1818
Original file line number Diff line number Diff line change @@ -13,9 +13,13 @@ class AddIndexKeyPeopleTable extends Migration
1313 */
1414 public function up ()
1515 {
16- Schema::table ('people ' , function (Blueprint $ table ) {
17- $ table ->index (['id ' , 'uid ' ]);
18- });
16+ if (Schema::hasTable ('people ' )) {
17+ Schema::table ('people ' , function (Blueprint $ table ) {
18+ if (Schema::hasColumn ('people ' , 'uid ' )) {
19+ $ table ->index (['id ' , 'uid ' ]);
20+ }
21+ });
22+ }
1923 }
2024
2125 /**
@@ -25,8 +29,12 @@ public function up()
2529 */
2630 public function down ()
2731 {
28- Schema::table ('people ' , function (Blueprint $ table ) {
29- $ table ->dropIndex (['id ' , 'uid ' ]);
30- });
32+ if (Schema::hasTable ('people ' )) {
33+ Schema::table ('people ' , function (Blueprint $ table ) {
34+ if (Schema::hasColumn ('people ' , 'uid ' )) {
35+ $ table ->dropIndex (['id ' , 'uid ' ]);
36+ }
37+ });
38+ }
3139 }
3240}
You can’t perform that action at this time.
0 commit comments