Git Product home page Git Product logo

Comments (4)

janpio avatar janpio commented on September 26, 2024

Do I understand that you start a server running Prisma schema version 1, then migrate the database to Prisma schema version 2, change the data in the database to use an enum value of Prisma schema version 2, and then your already running server fails as it can not handle the new enum value that is being return for queries that concern the data that was changed?

from prisma.

pimmee avatar pimmee commented on September 26, 2024

Do I understand that you start a server running Prisma schema version 1, then migrate the database to Prisma schema version 2, change the data in the database to use an enum value of Prisma schema version 2, and then your already running server fails as it can not handle the new enum value that is being return for queries that concern the data that was changed?

Exactly!

If this is intended behavior feel free to change this issue to a feature request, i.e. to not throw error and instead ignore rows containing unknown enum values.

from prisma.

janpio avatar janpio commented on September 26, 2024

How would you expect Prisma to deal with the invalid data then?
How would your app deal with the data to be missing for this field?

from prisma.

Jolg42 avatar Jolg42 commented on September 26, 2024

I think this is currently expected.

Because the Prisma Client was generated with the given enum in the schema

enum MyEnum {
  A
}

And does not know about the new enum value yet.

So after updating your Prisma schema and applying the migration you must also re-generate the Prisma Client with npx prisma generate

from prisma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.