This commit is contained in:
2023-03-03 13:45:51 +01:00
parent 7a06ea248e
commit 3d13369e05
92 changed files with 15859 additions and 66 deletions

View File

@@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('lignes_commandes', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('commandes_id')->unsigned();
$table->bigInteger('produits_id')->unsigned()->nullable();
$table->integer('quantite')->nullable();
$table->float('prix_vente')->nullable();
$table->timestamps();
});
Schema::table('lignes_commandes', function (Blueprint $table) {
$table->foreign('commandes_id')->references('id')->on('commandes')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('produits_id')->references('id')->on('produits')->onUpdate('cascade')->onDelete('set null');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfexists('lignes_commandes');
}
};