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
prisma migrate dev will not allow for db level default on scalar list #11379
Comments
@janpio: hoping the above helps get this one some attention |
Super wild idea: Can you try adding a |
Any attempt to set default on list is not happy...
|
This would be a nice change and doesn't seem huge. Just allow the current syntax to be used without an artificial limitation |
Is |
No, rather |
Then the
With this is should generate proper SQL then. Buuuut, I know we are actually planning to add proper |
Wonderful! This issue is a bit of a blocker for me as well, so I've been watching this issue closely. |
This will soon be solved via #8330 |
Bug description
Similar to #8330, we have a field that we want to store in our Postgres db as a scalar list.
As stated here:
When we set the default in pg however, any subsequent run drops the default.
How to reproduce
CLI Output:
Answering
y
to the prompt then drops data and default on field.Answering
N
cancels migration and does not affect db, but prompt returns on next run.As an aside, if the steps above are repeated, except a new migration is generated for altering a different table/field, the new migration file is generated, but contains only intended changes:
However the default on the other field is also dropped.
Expected behavior
If prisma cannot support setting a DEFAULT on a scalar list (pity...), I should at least be able to set one on a db level and not have it reverted or cause issues with continuing workflow.
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: