2
0
Эх сурвалжийг харах

:construction: migrate book_word

visuddhinanda 4 жил өмнө
parent
commit
20a97115ce

+ 11 - 0
app/Models/BookWord.php

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

+ 34 - 0
database/migrations/2021_12_28_223422_create_book_words_table.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateBookWordsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('book_words', function (Blueprint $table) {
+            $table->id();
+			$table->integer('book');
+            $table->integer('wordindex')->index();
+            $table->integer('count');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('book_words');
+    }
+}