Răsfoiți Sursa

refactor(migrations): 统一数据库迁移文件格式

- 为所有迁移文件添加 declare(strict_types=1) 声明
- 移除旧版 Column 类的使用,改用数组配置方式定义字段
- 统一时间戳字段命名为 create_time 和 update_time
- 使用 addColumn 方法替代 addTimestamps 和 addSoftDelete
- 标准化字段定义参数格式,提升代码一致性
runphp 3 luni în urmă
părinte
comite
61c943aa2a

+ 4 - 3
database/migrations/20250704030421_extension_filesystem_cagegory.php

@@ -1,7 +1,8 @@
 <?php
 
+declare(strict_types=1);
+
 use Phinx\Migration\AbstractMigration;
-use think\migration\db\Column;
 
 class ExtensionFilesystemCagegory extends AbstractMigration
 {
@@ -63,8 +64,8 @@ class ExtensionFilesystemCagegory extends AbstractMigration
             'null' => false,
             'default' => 0,
             'comment' => '文件数量'
-        ])->addTimestamps()
-            ->addSoftDelete()
+        ])->addTimestamps('create_time', 'update_time')
+            ->addColumn('delete_time', 'timestamp', ['null' => true, 'comment' => '删除时间'])
             ->create();
     }
 }

+ 2 - 0
database/migrations/20250704031150_extension_filesystem_file.php

@@ -1,5 +1,7 @@
 <?php
 
+declare(strict_types=1);
+
 use Phinx\Migration\AbstractMigration;
 
 class ExtensionFilesystemFile extends AbstractMigration