Fixed updater

This commit is contained in:
Julian Prieber 2023-12-26 18:40:29 +01:00
parent 075f3600f3
commit e75121c613
1 changed files with 12 additions and 0 deletions

View File

@ -149,6 +149,18 @@ use App\Models\Page;
Page::first()->update(['home_message' => $home_message]);
}
$migrationFiles = glob(database_path('migrations/*.php'));
$fileNames = array_map(function ($file) {
return basename($file, '.php');
}, $migrationFiles);
foreach ($fileNames as $fileName) {
if (!DB::table('migrations')->where('migration', $fileName)->exists()) {
DB::table('migrations')->insert(['migration' => $fileName, 'batch' => 1]);
}
}
/* Updates button database entries */
Schema::disableForeignKeyConstraints();
$existingMigration = '2021_03_17_044922_create_buttons_table';