123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?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');
- }
- };
|