Skip to content

Fix task upsert failing on prod database - #1313

Merged
jake-low merged 1 commit into
mainfrom
jlow/fix-task-upsert-conflict
Nov 16, 2026
Merged

jake-low merged 1 commit into
mainfrom
jlow/fix-task-upsert-conflict

Conversation

@jake-low

Copy link
Copy Markdown
Contributor

Production has a unique index on tasks of (parent_id, md5(lower(name))), not the (parent_id, lower(name)) that the evolutions in this repo create. I'm not sure why they differ, probably someone modified the database by hand in the past. The difference means the ON CONFLICT added in #1300 does not work in prod, even though it worked in local testing.

This change fixes the ON CONFLICT to work with the index that's currently live, and adds an evolution to fix the index in local dev which is a no-op when run on prod.

Production has a unique index on tasks of (parent_id, md5(lower(name))),
not the (parent_id, lower(name)) that the evolutions in this repo create.
I'm not sure why they differ, probably someone modified the database by
hand in the past. The difference means the ON CONFLICT added in #1300
does not work in prod, even though it worked in local testing.

This change fixes the ON CONFLICT to work with the index that's currently
live, and adds an evolution to fix the index in local dev which is a
no-op when run on prod.
@sonarqubecloud

Copy link
Copy Markdown

@CollinBeczak

Copy link
Copy Markdown
Contributor

sbt scalafmt, and looks good to me!

@atiannicelli atiannicelli left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jake-low
jake-low merged commit 1563dee into main Nov 16, 2026
8 of 9 checks passed
@jake-low
jake-low deleted the jlow/fix-task-upsert-conflict branch November 16, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants