Skip to content

Commit

Permalink
Merge pull request #11709 from bdach/fix-versioning-table-schema
Browse files Browse the repository at this point in the history
Replace compound primary key on `beatmapset_version_files` with synthetic one
  • Loading branch information
nanaya authored Dec 4, 2024
2 parents 79a1eb1 + b0b6a53 commit ccf3fa8
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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.

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('beatmapset_version_files', function (Blueprint $table) {
$table->dropPrimary();
});
Schema::table('beatmapset_version_files', function (Blueprint $table) {
$table->bigIncrements('id')->first();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('beatmapset_version_files', function (Blueprint $table) {
$table->dropColumn('id');
});
Schema::table('beatmapset_version_files', function (Blueprint $table) {
$table->primary(['file_id', 'version_id']);
});
}
};

0 comments on commit ccf3fa8

Please sign in to comment.