-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2534 Updated indices which should make route popularity a bunch quic…
…ker. In theory.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
database/migrations/2024_10_02_132437_update_page_views_indices.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
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('page_views', function (Blueprint $table) { | ||
$table->dropIndex('page_views_model_class_index'); | ||
|
||
$table->index(['model_class', 'created_at', 'model_id'], 'page_views_popularity_index'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('page_views', function (Blueprint $table) { | ||
$table->dropIndex('page_views_popularity_index'); | ||
|
||
$table->index(['model_class']); | ||
}); | ||
} | ||
}; |
28 changes: 28 additions & 0 deletions
28
database/migrations/2024_10_02_133143_update_dungeon_routes_indices.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
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('dungeon_routes', function (Blueprint $table) { | ||
$table->index(['published_state_id', 'clone_of']); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('dungeon_routes', function (Blueprint $table) { | ||
$table->dropIndex(['published_state_id', 'clone_of']); | ||
}); | ||
} | ||
}; |