kphcdr il y a 1 an
Parent
commit
93013fce69
1 fichiers modifiés avec 45 ajouts et 0 suppressions
  1. 45 0
      database/migrations/2023_04_28_071852_create_goods_table.php

+ 45 - 0
database/migrations/2023_04_28_071852_create_goods_table.php

@@ -0,0 +1,45 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration {
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('spec', function (Blueprint $table) {
+            $table->id();
+            $table->string("name")->default("");
+            $table->string("extra", 2000)->default("");
+            $table->unsignedInteger("index_weight")->default(0);
+            $table->unsignedInteger("category_weight")->default(0);
+            $table->unsignedInteger("search_weight")->default(0);
+            $table->unsignedTinyInteger("is_custom")->default(0)->comment("是否自定义");
+            $table->timestamps();
+            $table->softDeletes();
+        });
+        Schema::create("spec_attr", function (Blueprint $t) {
+            $t->id();
+            $t->unsignedInteger("spec_id");
+            $t->string("name");
+            $t->timestamps();
+            $t->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('spec');
+        Schema::dropIfExists('spec_attr');
+    }
+};