Răsfoiți Sursa

:construction: migrate PaliSentIndex

visuddhinanda 4 ani în urmă
părinte
comite
bce5a42ed3

+ 11 - 0
app/Models/PaliSentIndex.php

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

+ 35 - 0
database/migrations/2021_12_29_025311_create_pali_sent_indices_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePaliSentIndicesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('pali_sent_indices', function (Blueprint $table) {
+            $table->id();
+			$table->integer('book');
+			$table->integer('para');
+			$table->integer('strlen');
+			$table->timestamp('created_at')->useCurrent();
+			$table->index(['book','para']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('pali_sent_indices');
+    }
+}

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

@@ -183,7 +183,7 @@ define("_SRC_TABLE_WORD_STATISTICS_", "word");
 define("_FILE_DB_PALI_SENTENCE_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
 define("_TABLE_PALI_SENT_", "pali_sentences");
 define("_TABLE_PALI_SENT_ORG_", "pali_sent_orgs");
-define("_TABLE_PALI_SENT_INDEX_", "pali_sent_indexs");
+define("_TABLE_PALI_SENT_INDEX_", "pali_sent_indices");
 
 define("_SRC_DB_PALI_SENTENCE_", "sqlite:" . __DIR__ . "/../tmp/appdata/palicanon/pali_sent1.db3");
 define("_TABLE_SRC_PALI_SENT_", "pali_sent");