Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UPDATE before adding invoice cancel constraint #1792

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ekzyis
Copy link
Member

@ekzyis ekzyis commented Jan 3, 2025

Description

Fix migration that was added in #1785. I assume changing the existing migration is okay because it didn't run in prod.

Checklist

Are your changes backwards compatible? Please answer below:

yes, they will fix that #1785 was not backwards compatible with existing data in prod

On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:

5. Run migration locally but after sndev delete so I did not have any invoices anyway. But I am pretty sure this will fix the constraint failure in prod.

For frontend changes: Tested on mobile, light and dark mode? Please answer below:

n/a

Did you introduce any new environment variables? If so, call them out explicitly here:

no

@ekzyis ekzyis added the bug label Jan 3, 2025
@ekzyis
Copy link
Member Author

ekzyis commented Jan 4, 2025

I have verified locally that updating the old checksum 6c57e2e384fefdfa2d68c17fc49747c5e8d75d1628b31460cdd07e7747c5d841 to the new checksum cafea2458befe90010c028bc2d9ea361f1d7d1b4e1fc3f0921136c3cdaf6f4db makes npx prisma migrate dev run without errors:

2025-01-04.20-47-59.mp4

So I think we should merge this and then run

UPDATE _prisma_migrations
SET checksum = 'cafea2458befe90010c028bc2d9ea361f1d7d1b4e1fc3f0921136c3cdaf6f4db'
WHERE checksum = '6c57e2e384fefdfa2d68c17fc49747c5e8d75d1628b31460cdd07e7747c5d841';

before the next deployment.

But even without this update, migration in prod should not even show a warning anymore since the warning was removed in v3.12.0, see Prisma docs. It will only show up in prisma migrate status, see prisma/prisma#9829 and prisma/docs#5244.

So this should be safe to merge so local dev is not broken for seeds with invoices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant