Bug description
Prisma migrate has some weird behavior when it comes to ENUMs. I made a change to a model consisting of making a field of type String required and also changing the type of another field from String to ENUM like NewEnumType. When running migrate dev command, the generated migration included the first change only. I then manually altered the table and introspected again, it could see the ENUM, but all other ENUM fields that I added to the datamodel were gone. So I basically have to manually alter multiple models instead of achieving that through migrate.
How to reproduce
- Migrating from [email protected] to the latest version.
- the upgrade cli had an issue of recognizing ENUMs, it just branded them as of type MEDIUMTEXT
1- Change a field name in a model.
2- Change another field type in the same model to an ENUM type; like ItemType.
3- Defined enum ItemType at the bottom of the datamodel file.
4- Ran migration dev.
5- Generated migration included the name change only.
Expected behavior
The generated migration should have recognized that there has been a change to a field of type String to ENUM.
Prisma information
Using the latest Prisma 2.17
Environment & setup
- OS: Ubuntu 18
- Database: MySQL hosted on RDS
- Node.js version: 14.15.1
- Prisma version:
prisma : 2.17.0
@prisma/client : 2.17.0
Current platform : debian-openssl-1.1.x
Query Engine : query-engine 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine : migration-engine-cli 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Studio : 0.353.0
Bug description
Prisma migrate has some weird behavior when it comes to ENUMs. I made a change to a model consisting of making a field of type String required and also changing the type of another field from String to ENUM like NewEnumType. When running migrate dev command, the generated migration included the first change only. I then manually altered the table and introspected again, it could see the ENUM, but all other ENUM fields that I added to the datamodel were gone. So I basically have to manually alter multiple models instead of achieving that through migrate.
How to reproduce
1- Change a field name in a model.
2- Change another field type in the same model to an ENUM type; like ItemType.
3- Defined enum ItemType at the bottom of the datamodel file.
4- Ran migration dev.
5- Generated migration included the name change only.
Expected behavior
The generated migration should have recognized that there has been a change to a field of type String to ENUM.
Prisma information
Using the latest Prisma 2.17
Environment & setup