the browser-facing portion of osu!
1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6use Illuminate\Database\Migrations\Migration;
7use Illuminate\Database\Schema\Blueprint;
8
9class CreateBeatmapsetEvents extends Migration
10{
11 /**
12 * Run the migrations.
13 *
14 * @return void
15 */
16 public function up()
17 {
18 Schema::create('beatmapset_events', function (Blueprint $table) {
19 $table->bigIncrements('id');
20 $table->mediumInteger('beatmapset_id')->unsigned();
21 $table->mediumInteger('user_id')->unsigned()->nullable();
22 $table->enum('type', ['nominate', 'qualify', 'disqualify', 'approve']);
23 $table->text('comment')->nullable();
24 $table->timestamps();
25
26 $table->foreign('beatmapset_id')
27 ->references('beatmapset_id')
28 ->on('osu_beatmapsets')
29 ->onDelete('RESTRICT');
30
31 $table->index('type');
32 });
33 }
34
35 /**
36 * Reverse the migrations.
37 *
38 * @return void
39 */
40 public function down()
41 {
42 Schema::drop('beatmapset_events');
43 }
44}