Whoops.... Fix env replacement...

Somehow this got copy pasta'd and yeh.... its not right...
This commit is contained in:
notCharles 2024-06-07 22:18:12 -04:00
parent dd7a01aa04
commit c5824ff26c
2 changed files with 42 additions and 1 deletions

View File

@ -17,7 +17,8 @@ class EggParserService
'server.build.default.port' => 'server.allocations.default.port',
'server.build.env.SERVER_MEMORY' => 'server.build.memory_limit',
'server.build.memory' => 'server.build.memory_limit',
'server.build.env' => 'server.build.environment',
'server.build.env' => 'server.environment',
'server.build.environment' => 'server.environment',
];
/**

View File

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$eggs = DB::table('eggs')->get();
foreach ($eggs as $egg) {
$updatedEnv = str_replace(
'server.build.environment.',
'server.environment.',
$egg->config_files
);
if ($updatedEnv !== $egg->config_files) {
$egg->config_files = $updatedEnv;
echo "Processed ENV update with ID: {$egg->name}\n";
}
DB::table('eggs')
->where('id', $egg->id)
->update(['config_files' => $egg->config_files]);
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// We shouldn't revert this...
}
};