Files
ERP-upgrade/database/migrations/2026_09_15_181659_create_servers_table.php
2026-09-22 08:06:31 +00:00

35 lines
1.0 KiB
PHP

<?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('servers', function (Blueprint $table) {
$table->id();
$table->string('name'); // e.g., "Main PBX Engine" or "Synology NAS"
$table->string('ip_address');
$table->string('os_version')->nullable(); // e.g., "AlmaLinux 9", "Debian"
$table->string('username')->default('root');
$table->text('password'); // Will be encrypted via Model casting
$table->json('services')->nullable(); // Array of services like ['Docker', 'PostGIS', 'Dovecot']
$table->string('status')->default('Active');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('servers');
}
};