db seeder
This commit is contained in:
@@ -12,14 +12,22 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('commandes', function (Blueprint $table) {
|
||||
Schema::create('commandes', function (Blueprint $table){
|
||||
$table->engine = 'InnoDB';
|
||||
|
||||
$table->bigIncrements('id')->unsigned();
|
||||
$table->date('date')->nullable();
|
||||
$table->json('adresse')->default(new Expression('(JSON_OBJECT())'));
|
||||
$table->date('date');
|
||||
$table->bigInteger('clients_id')->unsigned();
|
||||
$table->json("adresse")->default(new Expression('(JSON_OBJECT())'));
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->index("date");
|
||||
$table->index("clients_id");
|
||||
});
|
||||
|
||||
Schema::table('commandes', function (Blueprint $table){
|
||||
$table->foreign('clients_id')->references('id')->on('clients')->onUpdate('cascade')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,6 +36,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfexists('commandes');
|
||||
Schema::dropIfExists('commandes');
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user