fix: 🐛 hotfix migrations
This commit is contained in:
parent
a4280a6fba
commit
7754041532
|
@ -77,6 +77,10 @@ class CreatePayPalSettings extends SettingsMigration
|
||||||
// Always get the first value of the key.
|
// Always get the first value of the key.
|
||||||
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
|
$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.
|
// Handle the old values to return without it being a string in all cases.
|
||||||
if ($old_value->type === "string" || $old_value->type === "text") {
|
if ($old_value->type === "string" || $old_value->type === "text") {
|
||||||
if (is_null($old_value->value)) {
|
if (is_null($old_value->value)) {
|
||||||
|
|
|
@ -75,6 +75,10 @@ class CreateStripeSettings extends SettingsMigration
|
||||||
// Always get the first value of the key.
|
// Always get the first value of the key.
|
||||||
$old_value = DB::table('settings_old')->where('key', '=', $key)->get(['value', 'type'])->first();
|
$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.
|
// Handle the old values to return without it being a string in all cases.
|
||||||
if ($old_value->type === "string" || $old_value->type === "text") {
|
if ($old_value->type === "string" || $old_value->type === "text") {
|
||||||
if (is_null($old_value->value)) {
|
if (is_null($old_value->value)) {
|
||||||
|
|
|
@ -26,7 +26,8 @@ return new class extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->integer('pterodactyl_id')->nullable->change();
|
// make the column nullable again
|
||||||
|
$table->integer('pterodactyl_id')->nullable()->change();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue