feature/modelos-y-migraciones #3

Merged
rho merged 28 commits from feature/modelos-y-migraciones into master 2024-03-14 16:34:44 -03:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 3635e29cf4 - Show all commits

View File

@ -12,11 +12,11 @@
public function up(): void
{
Schema::create('productos_pedidos', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('pedido_id');
$table->unsignedBigInteger('producto_id');
$table->unsignedInteger('ammount');
$table->timestamps();
$table->primary(['pedido_id','producto_id']);
$table->foreign('pedido_id')->references('id')->on('pedidos');
$table->foreign('producto_id')->references('id')->on('productos');
});

View File

@ -12,10 +12,10 @@
public function up(): void
{
Schema::create('productos_caracteristicas', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('producto_id');
$table->unsignedBigInteger('caracteristica_id');
$table->timestamps();
$table->primary(['producto_id','caracteristica_id']);
$table->foreign('producto_id')->references('id')->on('productos');
$table->foreign('caracteristica_id')->references('id')->on('caracteristicas');
});