sub2api icon indicating copy to clipboard operation
sub2api copied to clipboard

唯一约束的问题

Open iqc19955 opened this issue 11 months ago • 4 comments

2025/12/30 12:58:04 Initializing database...
2025/12/30 12:58:05 [AutoMigrate] Failed to create default group anthropic-default: ERROR: duplicate key value violates unique constraint "idx_groups_name" (SQLSTATE 23505)
2025/12/30 12:58:05 Auto setup failed: database initialization failed: ERROR: duplicate key value violates unique constraint "idx_groups_name" (SQLSTATE 23505)

2025/12/30 12:58:05 /home/runner/work/sub2api/sub2api/backend/internal/repository/auto_migrate.go:97 ERROR: duplicate key value violates unique constraint "idx_groups_name" (SQLSTATE 23505)
[2.741ms] [rows:0] INSERT INTO "groups" ("name","description","platform","rate_multiplier","is_exclusive","status","subscription_type","daily_limit_usd","weekly_limit_usd","monthly_limit_usd","created_at","updated_at","deleted_at") VALUES ('anthropic-default','Default group for Anthropic accounts (Simple Mode)','anthropic',1,false,'active','standard',NULL,NULL,NULL,'2025-12-30 12:58:05.521','2025-12-30 12:58:05.521',NULL) RETURNING "id"

初始化数据库时 貌似会检查唯一约束,导致应用无法启动

iqc19955 avatar Dec 30 '25 05:12 iqc19955

+1

7836246 avatar Dec 30 '25 06:12 7836246

+1

GoldenTangerine avatar Dec 30 '25 06:12 GoldenTangerine

https://github.com/Wei-Shaw/sub2api/commit/fb883f0092dfec869e72fbdf8c2efb0907700900

Wei-Shaw avatar Dec 30 '25 06:12 Wei-Shaw

https://github.com/Wei-Shaw/sub2api/releases/tag/v0.1.32

Wei-Shaw avatar Dec 30 '25 06:12 Wei-Shaw