Skip to content

Commit bc2b2be

Browse files
authored
Merge pull request #439 from CnCNet/develop
* Index for table ip_address_histories * Added spawn.ini option
2 parents 1a5b7de + 9830685 commit bc2b2be

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('ip_address_histories', function (Blueprint $table) {
15+
// Optimize equality lookups: WHERE user_id=? AND ip_address_id=?
16+
$table->index(['user_id', 'ip_address_id'], 'idx_iah_user_ip');
17+
18+
// Optimize lookups by ip_address_id alone: WHERE ip_address_id=? AND user_id != ?
19+
$table->index('ip_address_id', 'idx_iah_ip_address_id');
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*/
26+
public function down(): void
27+
{
28+
Schema::table('ip_address_histories', function (Blueprint $table) {
29+
$table->dropIndex('idx_iah_user_ip');
30+
$table->dropIndex('idx_iah_ip_address_id');
31+
});
32+
}
33+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
use App\Models\SpawnOption;
7+
use App\Models\SpawnOptionType;
8+
9+
return new class extends Migration
10+
{
11+
/**
12+
* Run the migrations.
13+
*/
14+
public function up(): void
15+
{
16+
SpawnOption::makeOne(SpawnOptionType::SPAWN_INI, "Settings.AutoSaveInterval", "Settings", "AutoSaveInterval")->save(); // 0
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*/
22+
public function down(): void
23+
{
24+
//
25+
}
26+
};

0 commit comments

Comments
 (0)