Skip to content

Commit

Permalink
More table clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Jan 16, 2024
1 parent 07aa036 commit 64a6ff3
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ private static function resetView(): void
public function up(): void
{
Schema::drop('solo_scores');
Schema::drop('solo_scores_performance');
DB::statement("CREATE TABLE `solo_scores` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`user_id` int unsigned NOT NULL,
Expand Down Expand Up @@ -47,6 +46,12 @@ public function up(): void
KEY `legacy_score_lookup` (`ruleset_id`,`legacy_score_id`)
)");

DB::statement('DROP VIEW score_legacy_id_map');
Schema::drop('solo_scores_legacy_id_map');

DB::statement('DROP VIEW score_performance');
Schema::drop('solo_scores_performance');

static::resetView();
}

Expand All @@ -68,11 +73,21 @@ public function down(): void
KEY `user_ruleset_index` (`user_id`,`ruleset_id`),
KEY `beatmap_user_index` (`beatmap_id`,`user_id`)
)");

DB::statement('CREATE TABLE `solo_scores_legacy_id_map` (
`ruleset_id` smallint unsigned NOT NULL,
`old_score_id` bigint unsigned NOT NULL,
`score_id` bigint unsigned NOT NULL,
PRIMARY KEY (`ruleset_id`,`old_score_id`)
)');
DB::statement('CREATE VIEW score_legacy_id_map AS SELECT * FROM solo_scores_legacy_id_map');

DB::statement('CREATE TABLE `solo_scores_performance` (
`score_id` bigint unsigned NOT NULL,
`pp` float DEFAULT NULL,
PRIMARY KEY (`score_id`)
)');
DB::statement('CREATE VIEW score_performance AS SELECT * FROM solo_scores_performance');

static::resetView();
}
Expand Down

0 comments on commit 64a6ff3

Please sign in to comment.