uuid("uuid")->primary(); $table->timestamps(); $table->string("name")->index()->unique(); }); Schema::create('categories_products', function (Blueprint $table) { $table->id(); $table->timestamps(); $table->foreignUuid("product_uuid")->references("uuid")->on("products")->cascadeOnDelete()->cascadeOnUpdate(); $table->foreignUuid("category_uuid")->references("uuid")->on("categories")->cascadeOnDelete()->cascadeOnUpdate(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('categories'); } }