fix: 🐛 hotfix migrations

This commit is contained in:
IceToast 2023-05-03 15:17:35 +02:00
parent a4280a6fba
commit 7754041532
3 changed files with 10 additions and 1 deletions

View file

@ -77,6 +77,10 @@ class CreatePayPalSettings extends SettingsMigration
// Always get the first value of the key.
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
if (is_null($old_value)) {
return null;
}
// Handle the old values to return without it being a string in all cases.
if ($old_value->type === "string" || $old_value->type === "text") {
if (is_null($old_value->value)) {

View file

@ -75,6 +75,10 @@ class CreateStripeSettings extends SettingsMigration
// Always get the first value of the key.
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
if (is_null($old_value)) {
return null;
}
// Handle the old values to return without it being a string in all cases.
if ($old_value->type === "string" || $old_value->type === "text") {
if (is_null($old_value->value)) {

View file

@ -26,7 +26,8 @@ return new class extends Migration
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->integer('pterodactyl_id')->nullable->change();
// make the column nullable again
$table->integer('pterodactyl_id')->nullable()->change();
});
}
};