Explorar o código

:construction: migrate Bold

visuddhinanda %!s(int64=4) %!d(string=hai) anos
pai
achega
49ff06e189

+ 11 - 0
app/Models/Bold.php

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

+ 39 - 0
database/migrations/2021_12_29_022234_create_bolds_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateBoldsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('bolds', function (Blueprint $table) {
+            $table->id();
+			$table->integer('book');
+            $table->integer('paragraph');
+            $table->string('word',1024)->index();
+            $table->string('word2',1024);
+            $table->string('word_en',1024)->index();
+            $table->text('pali');
+            $table->text('base');
+			$table->timestamp('created_at')->useCurrent();
+			$table->index(['book','paragraph']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('bolds');
+    }
+}

+ 1 - 1
public/app/config.sample.php

@@ -148,7 +148,7 @@ define("_TABLE_WORD_BOLD_", "bold");
 
 //PostgreSQL
 //define("_FILE_DB_BOLD_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
-//define("_TABLE_WORD_BOLD_", "bold");
+//define("_TABLE_WORD_BOLD_", "bolds");
 
 /*
 单词分析表