tabla faltante

This commit is contained in:
Alejandro Tasistro 2024-07-09 20:09:29 -03:00
parent 197230a4ba
commit f9a5b5bca7

View file

@ -21,6 +21,16 @@ return new class extends Migration
$table->foreign('barrio_id')->references('id')->on('barrios'); $table->foreign('barrio_id')->references('id')->on('barrios');
$table->unique(['barrio_id','nombre']); $table->unique(['barrio_id','nombre']);
}); });
Schema::create('pedido_producto', function (Blueprint $table) {
$table->unsignedBigInteger('pedido_id');
$table->unsignedBigInteger('producto_id');
$table->unsignedInteger('cantidad');
$table->timestamps();
$table->primary(['pedido_id','producto_id']);
$table->foreign('pedido_id')->references('id')->on('pedidos');
$table->foreign('producto_id')->references('id')->on('productos');
});
} }
/** /**
@ -29,5 +39,6 @@ return new class extends Migration
public function down(): void public function down(): void
{ {
Schema::dropIfExists('pedidos'); Schema::dropIfExists('pedidos');
Schema::dropIfExists('pedido_producto');
} }
}; };