Skip to content

Commit 408557d

Browse files
authored
fix: on conflict constraint (#3378)
1 parent 1ea37c9 commit 408557d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • services/apps/git_integration/src/crowdgit/database

services/apps/git_integration/src/crowdgit/database/crud.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ async def upsert_maintainer(
196196
):
197197
sql_query = """
198198
INSERT INTO "maintainersInternal"
199-
("role", "originalRole", "repoUrl", "repoId", "identityId", "startDate")
200-
VALUES ($1, $2, $3, $4, $5, $6)
201-
ON CONFLICT ("repoId", "identityId") DO UPDATE
199+
("role", "originalRole", "repoUrl", "repoId", "identityId", "startDate", "endDate")
200+
VALUES ($1, $2, $3, $4, $5, $6, $7)
201+
ON CONFLICT ("repoId", "identityId", "startDate", "endDate") DO UPDATE
202202
SET role = EXCLUDED.role, "originalRole" = EXCLUDED."originalRole", "updatedAt" = NOW()
203203
"""
204204
await execute(
205205
sql_query,
206-
(role, original_role, repo_url, repo_id, identity_id, start_date),
206+
(role, original_role, repo_url, repo_id, identity_id, start_date, None),
207207
)
208208

209209

0 commit comments

Comments
 (0)