Skip to content

Commit

Permalink
Merge branch 'master' into drop-unused-columns
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy authored Oct 26, 2023
2 parents a7e51ed + 546c34b commit 33a2ccc
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

declare(strict_types=1);

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

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('user_profile_customizations', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable(false)->default(null)->change();
$table->dropColumn('id');
$table->primary('user_id');
$table->dropIndex('user_profile_customizations_user_id_unique');
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('user_profile_customizations', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable(false)->default(0)->change();
$table->unique('user_id');
$table->dropPrimary('user_id');
});

Schema::table('user_profile_customizations', function (Blueprint $table) {
$table->increments('id')->first();
});
}
};

0 comments on commit 33a2ccc

Please sign in to comment.