mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
fix(secrets): target the scope index in the secrets upsert
A bare ON CONFLICT DO UPDATE fires on any unique constraint violation; naming idx_secrets_scope keeps a future constraint from silently redirecting the update.
This commit is contained in:
1 parent
e46cf516c5
commit
a0d1d91f18
1 file changed
+1
-1
@@ -52,7 +52,7 @@ export class SecretsService {
|
||||
.prepare(
|
||||
`INSERT INTO secrets (kind, repo_id, environment, name, value, created_at, updated_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?)
|
||||
ON CONFLICT DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at`,
|
||||
ON CONFLICT(kind, COALESCE(repo_id, 0), environment, name) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at`,
|
||||
)
|
||||
.run(kind, repoId, normalizedEnvironment, name, storedValue, now, now)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user