Skip to content

Commit

Permalink
Add singleton_temp column, update values, change singleton column, dr…
Browse files Browse the repository at this point in the history
…op singleton_temp.
  • Loading branch information
herpaderpaldent committed Jan 2, 2025
1 parent 3557783 commit 379a87f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions database/migrations/2025_01_02_185356_fix_killmail_items_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{

Schema::table('killmail_items', function (Blueprint $table) {
$table->integer('singleton_temp')->default(0);
});

DB::table('killmail_items')->where('singleton', true)->update(['singleton_temp' => 1]);

Schema::table('killmail_items', function (Blueprint $table) {
$table->integer('singleton')->default(0)->change();
});

DB::table('killmail_items')->where('singleton_temp', 1)->update(['singleton' => 1]);

Schema::table('killmail_items', function (Blueprint $table) {
$table->dropColumn('singleton_temp');
});

}
};

0 comments on commit 379a87f

Please sign in to comment.