id(); $table->string('name'); $table->decimal('price', 10, 2); $table->unsignedBigInteger('component_type_id'); // ссылка на тип компонента $table->json('specifications')->nullable(); // JSON-поле для характеристик $table->boolean('is_official')->default(false); // официальный или нет $table->unsignedBigInteger('created_by_user_id')->nullable(); // кто создал $table->timestamps(); $table->foreign('component_type_id')->references('id')->on('component_types'); $table->foreign('created_by_user_id')->references('id')->on('users')->onDelete('set null'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('components'); } };