فهرست منبع

custom_fields

peterguo 2 هفته پیش
والد
کامیت
948284d48a
1فایلهای تغییر یافته به همراه17 افزوده شده و 9 حذف شده
  1. 17 9
      database/migrations/tenant/2025_03_17_113521_add_custom_fields_to_task_container_file_table.php

+ 17 - 9
database/migrations/tenant/2025_03_17_113521_add_custom_fields_to_task_container_file_table.php

@@ -4,25 +4,33 @@ use Illuminate\Database\Migrations\Migration;
 use Illuminate\Database\Schema\Blueprint;
 use Illuminate\Support\Facades\Schema;
 
-return new class extends Migration
-{
+return new class extends Migration {
     /**
      * Run the migrations.
      */
     public function up(): void
     {
-        Schema::table('task_container_file', function (Blueprint $table) {
-            //
+        Schema::table('task', function (Blueprint $table) {
+            $table->json('custom_fields')->nullable()->comment("自定义字段");
+        });
+        Schema::table('files', function (Blueprint $table) {
+            $table->json('custom_fields')->nullable()->comment("自定义字段");
+        });
+        Schema::table('containers', function (Blueprint $table) {
+            $table->json('custom_fields')->nullable()->comment("自定义字段");
         });
     }
 
-    /**
-     * Reverse the migrations.
-     */
     public function down(): void
     {
-        Schema::table('task_container_file', function (Blueprint $table) {
-            //
+        Schema::table('task', function (Blueprint $table) {
+            $table->dropColumn('custom_fields');
+        });
+        Schema::table('files', function (Blueprint $table) {
+            $table->dropColumn('custom_fields');
+        });
+        Schema::table('containers', function (Blueprint $table) {
+            $table->dropColumn('custom_fields');
         });
     }
 };