I recently deleted a column in our User table and ran the following two commands:
yarn rw prisma migrate dev yarn rw g sdl user --force
All seemed to be going well, until I tried to insert a new user, and it would through an error telling me the field that I had deleted was missing. So in VSCode I searched the entire project and found no place in the code where this deleted field was referenced.
After a couple hours of digging, I finally found the issue
- The search in VSCode does not search the node_modules directory
- In the node_modules directory there is a .prisma directory that contains what I assume is a cache copy of the prisma.schema. When I opened this one up, it had an old version in it that still contained the deleted column
- I deleted the .prisma directory and re ran the migration and everything is back to working.
I’m not sure if this is a bug in the prisma migrate function or if I didn’t pass some option to it.
I’m using Redwood 6.1.0. I did not do the migration to Prisma 5 so I’m still using Prisma 4.