Răsfoiți Sursa

:construction: migrate book_title

visuddhinanda 4 ani în urmă
părinte
comite
2e1a43e92a

+ 11 - 0
app/Models/BookTitle.php

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

+ 37 - 0
database/migrations/2021_12_28_223702_create_book_titles_table.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateBookTitlesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('book_titles', function (Blueprint $table) {
+            $table->id();
+			$table->integer('book');
+            $table->integer('paragraph')->index();
+            $table->string('title',1024);
+            $table->timestamps();
+
+            $table->index(["book", "paragraph"]);
+
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('book_titles');
+    }
+}