Laravel 13 + Livewire/Volt app for managing client organizations, documents, passwords, flexible assets, virtual machines, contacts, domains, todos, shortcuts, and role-based user administration.
59 lines
2.3 KiB
PHP
59 lines
2.3 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
// "Configuration" duplicated the "FlexibleAsset" system (a generic,
|
|
// admin-configurable IT inventory) with a fixed set of fields — merged
|
|
// into flexible asset types instead of keeping two parallel models.
|
|
Schema::dropIfExists('configurations');
|
|
Schema::dropIfExists('configuration_statuses');
|
|
Schema::dropIfExists('configuration_types');
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::create('configuration_types', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->timestamps();
|
|
});
|
|
|
|
Schema::create('configuration_statuses', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->string('color')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
|
|
Schema::create('configurations', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('organization_id')->constrained()->cascadeOnDelete();
|
|
$table->foreignId('configuration_type_id')->constrained()->restrictOnDelete();
|
|
$table->foreignId('configuration_status_id')->nullable()->constrained()->nullOnDelete();
|
|
$table->foreignId('location_id')->nullable()->constrained()->nullOnDelete();
|
|
$table->foreignId('contact_id')->nullable()->constrained()->nullOnDelete();
|
|
$table->string('name');
|
|
$table->string('hostname')->nullable();
|
|
$table->string('primary_ip')->nullable();
|
|
$table->string('mac_address')->nullable();
|
|
$table->string('serial_number')->nullable();
|
|
$table->string('asset_tag')->nullable();
|
|
$table->string('manufacturer')->nullable();
|
|
$table->string('model')->nullable();
|
|
$table->string('operating_system')->nullable();
|
|
$table->date('installed_at')->nullable();
|
|
$table->date('warranty_expires_at')->nullable();
|
|
$table->text('notes')->nullable();
|
|
$table->boolean('is_archived')->default(false);
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
});
|
|
}
|
|
};
|