Skip to content

Commit c770937

Browse files
authored
Migration to convert former stock egg uuids (#2108)
1 parent 426643e commit c770937

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
5+
return new class extends Migration
6+
{
7+
public function up(): void
8+
{
9+
$mappings = [
10+
// Forge Minecraft
11+
'ed072427-f209-4603-875c-f540c6dd5a65' => [
12+
'new_uuid' => 'd6018085-eecc-42bf-bf8c-51ea45a69ace',
13+
'new_update_url' => 'https://raw.githubusercontent.com/pelican-eggs/minecraft/refs/heads/main/java/forge/egg-forge-minecraft.yaml',
14+
],
15+
16+
// Paper
17+
'5da37ef6-58da-4169-90a6-e683e1721247' => [
18+
'new_uuid' => '150956be-4164-4086-9057-631ae95505e9',
19+
'new_update_url' => 'https://raw.githubusercontent.com/pelican-eggs/minecraft/refs/heads/main/java/paper/egg-paper.yaml',
20+
],
21+
22+
// Garrys Mod
23+
'60ef81d4-30a2-4d98-ab64-f59c69e2f915' => [
24+
'new_uuid' => 'c0b2f96a-f753-4d82-a73e-6e5be2bbadd5',
25+
'new_update_url' => 'https://raw.githubusercontent.com/pelican-eggs/games-steamcmd/refs/heads/main/gmod/egg-garrys-mod.yaml',
26+
],
27+
];
28+
29+
foreach ($mappings as $oldUuid => $newData) {
30+
DB::table('eggs')->where('uuid', $oldUuid)->update([
31+
'uuid' => $newData['new_uuid'],
32+
'update_url' => $newData['new_update_url'],
33+
]);
34+
}
35+
}
36+
37+
public function down(): void
38+
{
39+
// Not needed
40+
}
41+
};

0 commit comments

Comments
 (0)