Fix migration
This commit is contained in:
parent
98a894fd1e
commit
78dfe881d2
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue