Refactor deployment process and enhance VM IP reservation logic; update email template for VM creation failure notifications

This commit is contained in:
baodev0
2026-07-13 11:53:00 +07:00
parent c1008d579c
commit 3403cb9ec5
4 changed files with 223 additions and 82 deletions
@@ -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]);
}
};