Explorar el Código

:construction: migrate PaliSentence

visuddhinanda hace 4 años
padre
commit
4529bcd573

+ 11 - 0
app/Models/PaliSentence.php

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

+ 44 - 0
database/migrations/2021_12_29_023712_create_pali_sentences_table.php

@@ -0,0 +1,44 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePaliSentencesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('pali_sentences', function (Blueprint $table) {
+            $table->id();
+            $table->integer('book');
+            $table->integer('paragraph');
+            $table->integer('word_begin');
+            $table->integer('word_end');
+            $table->integer('length');
+            $table->integer('count');
+            $table->text('text');
+            $table->text('html');
+            $table->text('sim_sents')->nullable();
+            $table->text('sim_sents_count')->default(0);
+			$table->timestamp('created_at')->useCurrent();
+			$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
+
+			$table->index(['book','paragraph','word_begin','word_end']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('pali_sentences');
+    }
+}