Skip to content
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 3.0.1 warns about breaking changes. #9171

Closed
Zn4rK opened this issue Sep 8, 2021 · 6 comments · Fixed by #9177
Closed

prisma 3.0.1 warns about breaking changes. #9171

Zn4rK opened this issue Sep 8, 2021 · 6 comments · Fixed by #9177
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. topic: prisma generate CLI: prisma generate
Milestone

Comments

@Zn4rK
Copy link

Zn4rK commented Sep 8, 2021

Bug description

It probably should warn about breaking changes, but this check:

if (parseInt(minor, 10) < 12) {

Is not correct since the switch to semver.

How to reproduce

Install prisma@3.0.1 and re-run prisma generate.

Expected behavior

No response

Prisma information

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

model Something {
  id        String @id @default(cuid())
  name      String
}

Environment & setup

  • OS: MacOS
  • Database: PostgreSQL
  • Node.js version: v14.17.1

Prisma Version

prisma                  : 3.0.1
@prisma/client          : 3.0.1
Current platform        : darwin
Query Engine (Node-API) : libquery-engine 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine        : migration-engine-cli 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine    : introspection-core 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary           : prisma-fmt 2452cc6313d52b8b9a96999ac0e974d0aedf88db (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash    : 2452cc6313d52b8b9a96999ac0e974d0aedf88db
Studio                  : 0.423.0
@Zn4rK Zn4rK added the kind/bug A reported bug. label Sep 8, 2021
@pantharshit00 pantharshit00 changed the title prisma 3.0.1 warns about breaking changes. prisma 3.0.1 does not warns about breaking changes. Sep 8, 2021
@Zn4rK
Copy link
Author

Zn4rK commented Sep 8, 2021

I don't understand the title change. This is a clean/new install. It shouldn't warn about breaking changes at all. The original title was correct.

Edit: Well, sure, the title change makes sense in the context of switching to semver, but the original report was because I got that message on a clean install.

@Zn4rK Zn4rK changed the title prisma 3.0.1 does not warns about breaking changes. prisma 3.0.1 warns about breaking changes. Sep 8, 2021
@janpio
Copy link
Member

janpio commented Sep 8, 2021

This is what I am seeing on a clean install:

C:\Users\Jan\Documents\throwaway\9171>npx prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma

✔ Generated Prisma Client (3.0.1) to .\node_modules\@prisma\client in 63ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
```
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
```

warn Prisma 2.12.0 has breaking changes.
You can update your code with
`npx @prisma/codemods update-2.12 ./`
Read more at https://pris.ly/2.12

Is that what you are seeing as well @Zn4rK?

@janpio janpio added bug/2-confirmed Bug has been reproduced and confirmed. topic: prisma generate CLI: prisma generate labels Sep 8, 2021
@Zn4rK
Copy link
Author

Zn4rK commented Sep 8, 2021

@janpio Yep, exactly.

@janpio janpio added the 3.x label Sep 8, 2021
@janpio
Copy link
Member

janpio commented Sep 8, 2021

Ok, so this is comparing the previous version in the project with the current version - and on a new project this now seems to return a number < 12 - which makes sense on 3.0.1 of course. What is missing is the confirmation that the old version was also major 2.

Then we can additionally also think if we should output a warning that reminds people to look at the breaking changes in 3.x if they upgrade from 2.x.

Does that make sense?

@janpio
Copy link
Member

janpio commented Sep 8, 2021

Thanks for reporting this @Zn4rK - a draft PR is up and we are now looking at if this is all correct, covered, if we can and should do more and so on. The message is really nothing to worry about of course really.

@pantharshit00
Copy link
Contributor

pantharshit00 commented Sep 9, 2021

Sorry for the title change that I did. I misread the issue and thought you were asking for a warning about breaking changes. Looks like this is already handled now.

@Jolg42 Jolg42 modified the milestones: 2.31.0 / 3.0.x, 3.1.0 Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. topic: prisma generate CLI: prisma generate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants