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;
7
8class AddMappingToFollows extends Migration
9{
10 /**
11 * Run the migrations.
12 *
13 * @return void
14 */
15 public function up()
16 {
17 DB::statement("ALTER TABLE follows
18 MODIFY COLUMN subtype
19 ENUM('comment', 'modding', 'mapping')
20 NOT NULL");
21 DB::table('follows')
22 ->where([
23 'subtype' => 'modding',
24 'notifiable_type' => 'user',
25 ])->update(['subtype' => 'mapping']);
26 }
27
28 /**
29 * Reverse the migrations.
30 *
31 * @return void
32 */
33 public function down()
34 {
35 DB::table('follows')
36 ->where([
37 'subtype' => 'mapping',
38 'notifiable_type' => 'user',
39 ])->update(['subtype' => 'modding']);
40 DB::statement("ALTER TABLE follows
41 MODIFY COLUMN subtype
42 ENUM('comment', 'modding')");
43 }
44}