id(); // БЕЗ поля year! Каталог общий для всех лет $table->string('article')->unique(); $table->string('used_in_maf')->nullable(); $table->foreignId('product_id')->nullable()->constrained('products')->nullOnDelete(); $table->text('note')->nullable(); // Цены в копейках (как в Product) $table->unsignedBigInteger('purchase_price')->nullable(); $table->unsignedBigInteger('customer_price')->nullable(); $table->unsignedBigInteger('expertise_price')->nullable(); $table->string('tsn_number')->nullable(); $table->text('pricing_code')->nullable(); $table->integer('min_stock')->default(0); $table->softDeletes(); $table->timestamps(); // Индексы без year $table->index('article'); $table->index('used_in_maf'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('spare_parts'); } };