update show ip & reinstall vps 50%

This commit is contained in:
Pham Bao
2025-08-04 00:35:54 +07:00
parent 160b7cdb47
commit fc277e5ef6
7 changed files with 683 additions and 93 deletions
@@ -0,0 +1,53 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('reinstall_logs', function (Blueprint $table) {
$table->id();
// Liên kết đến bảng sản phẩm (VPS/Hosting)
$table->unsignedBigInteger('product_id');
$table->unsignedTinyInteger('product_type'); // 3 = Hosting, 4 = VPS
// Liên kết tới user khởi tạo
$table->unsignedBigInteger('custome_id')->nullable();
// Template & OS được sử dụng
$table->unsignedBigInteger('os_id')->nullable(); // ID bảng operating_systems
$table->string('template_id')->nullable(); // VMware Template ID
// IP hiện tại (nếu cần)
$table->string('ip_address')->nullable();
// Trạng thái và kết quả
$table->enum('status', ['pending', 'success', 'failed'])->default('pending');
$table->text('error_message')->nullable();
// Metadata khác
$table->string('initiator')->nullable(); // 'user', 'admin', 'system'
$table->text('note')->nullable(); // Ghi chú tự do
$table->timestamps();
// Index
$table->index(['product_id', 'product_type']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('reinstall_logs');
}
};