Fixed databse errors when updating

This commit is contained in:
Julian Prieber 2022-11-19 17:48:48 +01:00
parent 30ac613a9b
commit ac77efe5a8
1 changed files with 4 additions and 8 deletions

View File

@ -25,15 +25,11 @@
if(EnvEditor::keyExists('USE_THEME_PREVIEW_IFRAME')){ /* Do nothing if key already exists */
} else {EnvEditor::addKey('USE_THEME_PREVIEW_IFRAME', 'true');}
if(trim(file_get_contents(base_path("version.json"))) >= '2.9.1' and trim(file_get_contents(base_path("version.json"))) <= '3.0.0'){
Schema::disableForeignKeyConstraints();
Artisan::call('migrate');
Schema::enableForeignKeyConstraints();
}
if(trim(file_get_contents(base_path("version.json"))) >= '2.9.1' and trim(file_get_contents(base_path("version.json"))) <= '3.0.0'){
if(EnvEditor::keyExists('ALLOW_USER_HTML')){EnvEditor::editKey('ALLOW_USER_HTML', 'true');}
}
// Adds database entries
Schema::disableForeignKeyConstraints();
Artisan::call('migrate');
Schema::enableForeignKeyConstraints();
if (!config()->has('advanced-config.expand_panel_admin_menu_permanently') and !config()->has('disable_default_password_notice')) {