id(); $table->string('name'); $table->string('legal_name'); $table->string('contract_number'); $table->date('contract_date'); $table->string('director_name'); $table->string('organization_form'); $table->string('tax_rate'); $table->text('contract_header'); $table->boolean('hidden')->default(false); $table->timestamps(); }); Schema::create('contractor_installation_prices', function (Blueprint $table) { $table->id(); $table->foreignId('contractor_id') ->constrained('contractors') ->cascadeOnDelete(); $table->foreignId('product_id') ->constrained('products') ->restrictOnDelete(); $table->unsignedInteger('catalog_year'); $table->string('name_in_spec')->nullable(); $table->unsignedBigInteger('price')->default(0); $table->timestamps(); $table->unique(['contractor_id', 'product_id', 'catalog_year'], 'contractor_price_unique'); }); } public function down(): void { Schema::dropIfExists('contractor_installation_prices'); Schema::dropIfExists('contractors'); } };