id(); $table->string('name'); $table->string('type')->default('docker'); // docker, swarm, k8s $table->string('host'); // unix:///var/run/docker.sock or tcp://host:port $table->boolean('tls_enabled')->default(false); $table->text('tls_cert')->nullable(); $table->text('tls_key')->nullable(); $table->text('tls_ca')->nullable(); $table->string('status')->default('unknown'); $table->json('info')->nullable(); // Docker engine info $table->timestamp('last_sync_at')->nullable(); $table->foreignId('created_by')->constrained('users'); $table->timestamps(); $table->softDeletes(); }); Schema::create('containers', function (Blueprint $table) { $table->id(); $table->foreignId('endpoint_id')->constrained('docker_endpoints')->cascadeOnDelete(); $table->string('container_id', 64); // Docker container ID $table->string('name'); $table->string('image'); $table->string('image_id')->nullable(); $table->string('status'); // running, stopped, paused, exited, dead $table->string('state')->nullable(); $table->json('ports')->nullable(); $table->json('volumes')->nullable(); $table->json('env')->nullable(); $table->json('labels')->nullable(); $table->json('networks')->nullable(); $table->bigInteger('created_at_unix')->nullable(); $table->timestamps(); $table->unique(['endpoint_id', 'container_id']); }); Schema::create('stacks', function (Blueprint $table) { $table->id(); $table->foreignId('endpoint_id')->constrained('docker_endpoints')->cascadeOnDelete(); $table->string('name'); $table->string('type')->default('compose'); // compose, swarm-stack $table->text('compose_content'); // docker-compose.yml content $table->json('env_vars')->nullable(); $table->string('status')->default('stopped'); $table->string('remote_id')->nullable(); $table->foreignId('created_by')->constrained('users'); $table->timestamps(); $table->softDeletes(); }); Schema::create('docker_images', function (Blueprint $table) { $table->id(); $table->foreignId('endpoint_id')->constrained('docker_endpoints')->cascadeOnDelete(); $table->string('image_id', 71); $table->json('repo_tags')->nullable(); $table->bigInteger('size')->default(0); $table->bigInteger('created_at_unix')->nullable(); $table->timestamps(); }); } public function down(): void { Schema::dropIfExists('docker_images'); Schema::dropIfExists('stacks'); Schema::dropIfExists('containers'); Schema::dropIfExists('docker_endpoints'); } };