tabla faltante

This commit is contained in:
Alejandro Tasistro 2024-07-09 20:09:29 -03:00
parent 197230a4ba
commit f9a5b5bca7
1 changed files with 11 additions and 0 deletions

View File

@ -21,6 +21,16 @@ public function up(): void
$table->foreign('barrio_id')->references('id')->on('barrios');
$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 @@ public function up(): void
public function down(): void
{
Schema::dropIfExists('pedidos');
Schema::dropIfExists('pedido_producto');
}
};