Browse Source

fix: 🐛 hotfix migrations

IceToast 2 years ago
parent
commit
7754041532

+ 4 - 0
app/Extensions/PaymentGateways/PayPal/migrations/2023_03_04_135248_create_pay_pal_settings.php

@@ -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)) {

+ 4 - 0
app/Extensions/PaymentGateways/Stripe/migrations/2023_03_04_181917_create_stripe_settings.php

@@ -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)) {

+ 2 - 1
database/migrations/2023_04_03_231829_update_users_table.php

@@ -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();
         });
     }
 };