Ver código fonte

add wbw-analysis table

visuddhinanda@gmail.com 4 anos atrás
pai
commit
b76485b0f3

+ 11 - 0
app/Models/WbwAnalysis.php

@@ -0,0 +1,11 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+class WbwAnalysis extends Model
+{
+    use HasFactory;
+}

+ 58 - 0
database/migrations/2022_02_07_012707_create_wbw_analyses_table.php

@@ -0,0 +1,58 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateWbwAnalysesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     
+     * @return void
+     */
+     /*
+     'userid',
+                            'pali',
+                            'book',
+                            'paragraph',
+                            'wid',
+                            'type',
+                            'data',
+                            'confidence',
+                            'lang',
+                            'modify_time')
+     */
+    public function up()
+    {
+        Schema::create('wbw_analyses', function (Blueprint $table) {
+            $table->id();
+            $table->bigInteger('wbw_id')->index();
+            $table->string('wbw_word',1024);
+            $table->integer('book_id');
+            $table->integer('paragraph');
+            $table->integer('wid');
+            $table->integer('type');
+            $table->text('data')->index();
+            $table->integer('confidence');
+            $table->string('lang',16);
+            $table->text('d1')->nullable()->index();//备用数据
+            $table->text('d2')->nullable()->index();//备用数据
+            $table->bigInteger('editor_id');//备用数据
+            $table->timestamps();
+
+            $table->index(['type','data']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('wbw_analyses');
+    }
+}