소스 검색

fix(migration): 添加定时任务日志表主键

runphp 1 주 전
부모
커밋
01074b9296
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      database/migrations/20260710140000_create_cron_job_log.php

+ 7 - 1
database/migrations/20260710140000_create_cron_job_log.php

@@ -12,9 +12,15 @@ class CreateCronJobLog extends AbstractMigration
             'comment' => '定时任务执行日志',
             'engine' => 'InnoDB',
             'collation' => 'utf8mb4_general_ci',
+            'id' => false,
+            'primary_key' => ['id'],
         ]);
 
-        $table->addColumn('name', 'string', [
+        $table->addColumn('id', 'biginteger', [
+            'identity' => true,
+            'signed' => false,
+            'comment' => '主键'
+        ])->addColumn('name', 'string', [
             'limit' => 100,
             'null' => false,
             'comment' => '任务名称'