Преглед изворни кода

:construction: migrate pali_text

visuddhinanda пре 4 година
родитељ
комит
6df15732ae

+ 11 - 0
app/Models/PaliText.php

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

+ 48 - 0
database/migrations/2021_12_28_222244_create_pali_texts_table.php

@@ -0,0 +1,48 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePaliTextsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('pali_texts', function (Blueprint $table) {
+            $table->id();
+			$table->integer('book');
+            $table->integer('paragraph');
+            $table->integer('level');
+            $table->string('class',255);
+            $table->text('toc');
+            $table->text('text');
+            $table->text('html');
+            $table->integer('lenght');
+            $table->integer('album_index');
+            $table->integer('chapter_len');
+            $table->integer('next_chapter');
+            $table->integer('prev_chapter');
+            $table->integer('parent');
+            $table->integer('chapter_strlen');
+
+            $table->timestamps();
+
+			$table->index(['book','paragraph']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('pali_texts');
+    }
+}