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
@default(dbgenerated(...))
results in never-ending migration change generation
#18659
Comments
Ohhhhh. Probably another important consideration here. If I mark the field |
What happens when you run |
Looks like it strips off the If |
Did you run
I by the way think we should probably not just close the issue, as |
Yes, I ran db pull with the existing schema.prisma in place. |
I suppose it is also probably worth noting that the SQL migration statement related to the
However, when I do |
I'm seeing this due to this line in my schema
|
Yes, yours is a "normal" case of this problem @razzeee, where the database just represents the same things slightly different. We have not figured out a good way how to automate fixing that. Ian on the other hand had found a "special" one with |
I'm also seeing this when creating a default time in a field:
Always creates a migration:
even when there are no other changes to make to the structure of the tables. If I run
If I replace my version with the version it suggests I no longer get the un-needed migrations. |
The solution here is, whenever using In my specific case with postgresql having the following schema:
actually generates
So then every time a |
Bug description
I have a field
multi_index
on a model:When I add the attribute
@default(dbgenerated("NULL"))
tomulti_index
,prisma migrate dev
no longer behaves idempotently, generating the following migration over and over, once per each time it is called:How to reproduce
See above
Expected behavior
I would have expected that a single
migration
gets generated to apply the migration.Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: