Deploy: The underlying column for the field `metadata` is optional but the field is declared required. Please declare it as optional by removing the `!`: `metadata: Metadata`.
Durza007 opened this issue · 1 comments
Describe the bug
Deploy with --no-migrate flag gives an error in the title, but before deploy was already executed without --no-migrate flag, and it was successful.
To Reproduce
Steps to reproduce the behavior:
- Clone https://github.com/Durza007/test-prisma-deploy
- run
docker-compose up -d
- run
npm run deploy
- run
npm run deploy-no-migrate
- See error
Expected behavior
There should be no errors.
Versions (please complete the following information):
- Connector:
Postgres
and/orMySQL
- Prisma Server:
1.34.10
prisma
CLI:prisma/1.34.10 (darwin-x64) node-v8.11.4
- OS:
OS X Catalina
Additional context
I was having trouble using prisma deploy to upgrade my database due to timeouts in the deploy command. Since this issue: #4247 has not been implemented I had to resort to upgrade database manually and then use prisma deploy --no-migrate
which also did not work due to this error.
If I make the underlying column required then the deploy will succeed but I will instead get errors when trying to insert rows via prisma since it seems that prisma creates the row first and then sets up the reference?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.