tabla faltante
This commit is contained in:
parent
197230a4ba
commit
f9a5b5bca7
1 changed files with 11 additions and 0 deletions
|
@ -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');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue