Andrew před 1 měsícem
rodič
revize
6f6d9abb6d

+ 30
- 0
database/migrations/2025_12_09_090018_add_order_column_to_upload_files_table.php Zobrazit soubor

@@ -0,0 +1,30 @@
1
+<?php
2
+
3
+use Illuminate\Database\Migrations\Migration;
4
+use Illuminate\Database\Schema\Blueprint;
5
+use Illuminate\Support\Facades\Schema;
6
+
7
+return new class extends Migration
8
+{
9
+    /**
10
+     * Run the migrations.
11
+     */
12
+    public function up(): void
13
+    {
14
+        Schema::table('upload_files', function (Blueprint $table) {
15
+            // Add default value to existing order column
16
+            $table->integer('order')->default(0)->change();
17
+        });
18
+    }
19
+
20
+    /**
21
+     * Reverse the migrations.
22
+     */
23
+    public function down(): void
24
+    {
25
+        Schema::table('upload_files', function (Blueprint $table) {
26
+            // Remove default value from order column
27
+            $table->integer('order')->change();
28
+        });
29
+    }
30
+};