Explorar el Código

:construction: migrate WordStatistic

visuddhinanda hace 4 años
padre
commit
d66e6aa5b1

+ 11 - 0
app/Models/WordStatistic.php

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

+ 40 - 0
database/migrations/2021_12_29_022844_create_word_statistics_table.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateWordStatisticsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('word_statistics', function (Blueprint $table) {
+            $table->id();
+            $table->integer('bookid')->index();
+            $table->string('word',1024)->index();
+            $table->integer('count');
+            $table->string('base',1024)->index();
+            $table->string('end1',256)->index();
+            $table->string('end2',256)->index();
+            $table->integer('type');
+            $table->integer('length');
+			$table->timestamp('created_at')->useCurrent();
+
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('word_statistics');
+    }
+}