Explorar o código

:construction: migrate Progress

visuddhinanda %!s(int64=4) %!d(string=hai) anos
pai
achega
4c60382a37

+ 11 - 0
app/Models/Progress.php

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

+ 38 - 0
database/migrations/2021_12_29_050502_create_progress_table.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateProgressTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('progress', function (Blueprint $table) {
+            $table->id();
+            $table->integer('book');
+            $table->integer('para');
+            $table->string('lang',16);
+            $table->integer('all_strlen');
+            $table->integer('public_strlen');
+			$table->timestamp('created_at')->useCurrent();
+			$table->index(['book','para']);
+			$table->index(['book','para','lang']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('progress');
+    }
+}

+ 1 - 1
public/app/config.sample.php

@@ -223,7 +223,7 @@ php ./app/upgrade/upgrade_pali_toc.php
 
 //PostgreSQL
 define("_FILE_DB_PALI_TOC_", _DB_ENGIN_.":host="._DB_HOST_.";port="._DB_PORT_.";dbname="._DB_NAME_.";user="._DB_USERNAME_.";password="._DB_PASSWORD_.";");
-define("_TABLE_PROGRESS_", "progresss");
+define("_TABLE_PROGRESS_", "progress");
 define("_TABLE_PROGRESS_CHAPTER_", "progress_chapters");