2023_05_11_064203_create_cart_table.php 765 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. return new class extends Migration {
  6. /**
  7. * Run the migrations.
  8. *
  9. * @return void
  10. */
  11. public function up()
  12. {
  13. Schema::create('cart', function (Blueprint $table) {
  14. $table->id();
  15. $table->unsignedInteger("user_id");
  16. $table->unsignedInteger("goods_id");
  17. $table->string("extra", 1000);
  18. $table->unsignedInteger("count")->default(1);
  19. $table->timestamps();
  20. });
  21. }
  22. /**
  23. * Reverse the migrations.
  24. *
  25. * @return void
  26. */
  27. public function down()
  28. {
  29. Schema::dropIfExists('cart');
  30. }
  31. };