Refactor deployment process and enhance VM IP reservation logic; update email template for VM creation failure notifications
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// Remove gateway IP (103.90.224.1) — không được cấp cho VM
|
||||
DB::table('ip_pools')
|
||||
->where('module_network_id', 1)
|
||||
->where('ip_address', '103.90.224.1')
|
||||
->delete();
|
||||
|
||||
// Backfill gateway cho toàn bộ pool network_id=1
|
||||
DB::table('ip_pools')
|
||||
->where('module_network_id', 1)
|
||||
->whereNull('gateway')
|
||||
->update(['gateway' => '103.90.224.1']);
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
DB::table('ip_pools')
|
||||
->where('module_network_id', 1)
|
||||
->update(['gateway' => null]);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user