id(); $table->string('name'); $table->string('provider'); // aws, alibaba, tencent, gcp, azure, digitalocean, vultr, hetzner $table->string('account_id')->nullable(); // AWS account ID, etc. $table->text('credentials'); // encrypted JSON $table->string('region')->nullable(); // default region $table->json('regions')->nullable(); // all available regions $table->boolean('is_active')->default(true); $table->string('status')->default('unknown'); $table->json('tags')->nullable(); $table->timestamp('last_sync_at')->nullable(); $table->foreignId('created_by')->constrained('users'); $table->timestamps(); $table->softDeletes(); }); Schema::create('cloud_resources', function (Blueprint $table) { $table->id(); $table->foreignId('account_id')->constrained('cloud_accounts')->cascadeOnDelete(); $table->string('resource_id'); // cloud provider resource ID $table->string('resource_type'); // ec2, ecs, rds, vpc, s3, etc. $table->string('name'); $table->string('status'); $table->string('region'); $table->json('properties')->nullable(); $table->json('tags')->nullable(); $table->decimal('monthly_cost', 10, 4)->nullable(); $table->timestamps(); $table->unique(['account_id', 'resource_id', 'resource_type']); }); } public function down(): void { Schema::dropIfExists('cloud_resources'); Schema::dropIfExists('cloud_accounts'); } };