Browse Source

:card_file_box: add uuid in pali text table

visuddhinanda@gmail.com 3 years ago
parent
commit
e848360f7f
1 changed files with 34 additions and 0 deletions
  1. 34 0
      database/migrations/2022_05_23_010426_use_uuid_in_pali_texts.php

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

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