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

:card_file_box: add uuid in progress-chapter table

visuddhinanda@gmail.com 3 лет назад
Родитель
Сommit
7cee82e242

+ 34 - 0
database/migrations/2022_05_23_070112_add_uuid_in_progress_chapters.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddUuidInProgressChapters extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('progress_chapters', function (Blueprint $table) {
+            //
+            $table->uuid('uid')->unique()->default(DB::raw('uuid_generate_v1mc()'));
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('progress_chapters', function (Blueprint $table) {
+            //
+            $table->dropColumn('uid');
+        });
+    }
+}