Fix migration

This commit is contained in:
1day2die 2023-05-08 12:35:52 +02:00
parent 98a894fd1e
commit 78dfe881d2

View file

@ -58,11 +58,16 @@ class CreateTicketSettings extends SettingsMigration
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
// Handle the old values to return without it being a string in all cases.
if (is_null($old_value)) {
return '';
}
if ($old_value->type === "string" || $old_value->type === "text") {
if (is_null($old_value->value)) {
return '';
}
// Some values have the type string, but their values are boolean.
if ($old_value->value === "false" || $old_value->value === "true") {
return filter_var($old_value->value, FILTER_VALIDATE_BOOL);