visuddhinanda 6 zile în urmă
părinte
comite
cb51ccf5d5

+ 34 - 0
api-v13/database/migrations/2026_05_12_084851_add_redirect_to_dhamma_terms.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     */
+    public function up(): void
+    {
+        Schema::table('dhamma_terms', function (Blueprint $table) {
+            $table->string('redirect', 1024)
+                ->nullable()->comment('重定向到另一个术语');
+
+            // 添加普通索引
+            $table->index('redirect');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down(): void
+    {
+        Schema::table('dhamma_terms', function (Blueprint $table) {
+            //
+            $table->dropIndex(['redirect']);
+            $table->dropColumn('redirect');
+        });
+    }
+};