Просмотр исходного кода

:construction: migrate res_index

visuddhinanda 4 лет назад
Родитель
Сommit
bddec702f1

+ 11 - 0
app/Models/ResIndex.php

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

+ 49 - 0
database/migrations/2021_12_28_220331_create_res_indices_table.php

@@ -0,0 +1,49 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateResIndicesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('res_indices', function (Blueprint $table) {
+            $table->id();
+            $table->integer('book');
+            $table->integer('paragraph');
+            $table->string('title',1024)->index();
+            $table->string('title_en',1024)->index();
+            $table->integer('level');
+            $table->integer('type');
+            $table->string('language',16);
+            $table->string('author',256);
+            $table->integer('editor');
+            $table->integer('share');
+            $table->integer('edition')->default(1);
+            $table->integer('hit')->default(0);
+            $table->integer('album');
+            $table->string('tag',1024);
+            $table->string('summary',1024);
+            
+			$table->timestamps('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
+            $table->timestamps('updated_at')->default(DB::raw('CURRENT_TIMESTAMP'));
+
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('res_indices');
+    }
+}