id(); $table->string('business_name'); $table->string('rfc')->nullable(); $table->string('email')->nullable(); $table->string('phone')->nullable(); $table->string('address')->nullable(); $table->string('postal_code')->nullable(); $table->text('notes')->nullable(); $table->timestamps(); }); } if (!Schema::hasColumn('inventory_movements', 'supplier_id')) { Schema::table('inventory_movements', function (Blueprint $table) { $table->foreignId('supplier_id') ->nullable() ->after('warehouse_to_id') ->constrained('suppliers') ->onDelete('restrict'); $table->index(['supplier_id', 'movement_type']); }); } } public function down(): void { Schema::table('inventory_movements', function (Blueprint $table) { if (Schema::hasColumn('inventory_movements', 'supplier_id')) { $table->dropForeign(['supplier_id']); $table->dropIndex(['supplier_id', 'movement_type']); $table->dropColumn('supplier_id'); } }); Schema::dropIfExists('suppliers'); } };