Browse Source

wbw migrate 完成

visuddhinanda 4 years ago
parent
commit
4f04f9586f

+ 52 - 0
database/migrations/2022_01_19_090727_create_wbws_table.php

@@ -0,0 +1,52 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateWbwsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('wbws', function (Blueprint $table) {
+            $table->bigInteger('id')->primary();
+			$table->string('uid',36)->uniqid()->index();
+			$table->string('block_uid',36)->nullable()->index();
+            $table->bigInteger('block_id')->nullable()->index();
+            $table->bigInteger('channel_id')->nullable()->index();
+			$table->integer('book_id');
+			$table->integer('paragraph');
+			$table->bigInteger('wid');
+			$table->string("word",1024);
+			$table->text("data")->default('');
+			$table->integer('status')->default(10);
+			$table->string('creator_uid',36);
+            $table->bigInteger('editor_id');
+            $table->bigInteger('create_time')->index();
+            $table->bigInteger('modify_time')->index();
+ 
+			$table->timestamp('created_at')->useCurrent();
+			$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
+			$table->timestamp('deleted_at')->nullable();
+
+			$table->index(['book_id','paragraph','wid']);
+			$table->index(['book_id','paragraph']);
+
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('wbws');
+    }
+}

+ 3 - 3
database/migrations/2022_01_19_110604_create_wbw_blocks_table.php

@@ -24,8 +24,8 @@ class CreateWbwBlocksTable extends Migration
 		*/
 		*/
         Schema::create('wbw_blocks', function (Blueprint $table) {
         Schema::create('wbw_blocks', function (Blueprint $table) {
             $table->bigInteger('id')->primary();
             $table->bigInteger('id')->primary();
+			$table->string('uid',36)->uniqid()->index();			
 			$table->string('parent_id',36)->nullable();
 			$table->string('parent_id',36)->nullable();
-			$table->string('uid',36)->uniqid();
 			$table->string('block_uid',36)->nullable()->index();
 			$table->string('block_uid',36)->nullable()->index();
             $table->bigInteger('block_id')->nullable()->index();
             $table->bigInteger('block_id')->nullable()->index();
             $table->bigInteger('channel_id')->nullable()->index();
             $table->bigInteger('channel_id')->nullable()->index();
@@ -39,8 +39,8 @@ class CreateWbwBlocksTable extends Migration
 			$table->string("lang",16);
 			$table->string("lang",16);
 			$table->integer('status')->default(10);
 			$table->integer('status')->default(10);
 
 
-            $table->bigInteger('create_time')->nullable()->index();
-            $table->bigInteger('modify_time')->nullable()->index();
+            $table->bigInteger('create_time')->index();
+            $table->bigInteger('modify_time')->index();
  
  
 			$table->timestamp('created_at')->useCurrent();
 			$table->timestamp('created_at')->useCurrent();
 			$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
 			$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();