fix(数据库): 修复默认分组缺失与迁移锁阻塞
通过迁移补种默认 groups 记录,避免新装空分组 迁移锁改为 try lock + 重试并加入超时 写入 usage_logs 时保留 rate_multiplier=0 语义 测试: go test ./...
This commit is contained in:
4
backend/migrations/008_seed_default_group.sql
Normal file
4
backend/migrations/008_seed_default_group.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Seed a default group for fresh installs.
|
||||
INSERT INTO groups (name, description)
|
||||
SELECT 'default', 'Default group'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM groups);
|
||||
Reference in New Issue
Block a user