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

Improve error when using prisma migrate --experimental with native types #4186

Closed
matthewmueller opened this issue Nov 9, 2020 · 0 comments · Fixed by #4188
Closed

Improve error when using prisma migrate --experimental with native types #4186

matthewmueller opened this issue Nov 9, 2020 · 0 comments · Fixed by #4188
Assignees
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: migrate

Comments

@matthewmueller
Copy link
Contributor

Bug description

Right now we throw an unexpected error when you try to save a migration with nativeTypes.

How to reproduce

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

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

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["nativeTypes"]
}

model User {
  id    Int    @id @default(autoincrement())
  first String
  last  String
  posts Post[]
}

model Post {
  id       Int    @id @default(autoincrement())
  title    String
  body     String
  user     User   @relation(fields: [userId], references: [id])
  userId   Int
  visitors BigInt
}
npx prisma migrate save --experimental
Environment variables loaded from /Users/m/Go/src/github.com/prisma/qa/.env
Prisma schema loaded from prisma/schema.prisma
Response "Some of the requested preview features are not yet allowed in migration engine. Please remove them from your data model before using migrations. (blocked: `nativeTypes`)"
Got result for unknown id undefined
Oops, an unexpected error occured!
Error in migration engine: Nov 09 10:42:13.778  INFO migration_engine: Starting migration engine RPC server git_hash="a624a6628b9e5e453bb8f8cb0460e233a3a97e62"

Please help us improve Prisma by submitting an error report.
Error reports never contain personal or other sensitive information.
Learn more: https://pris.ly/d/telemetry

? Submit error report › - Use arrow-keys. Return to submit.
❯   Yes - Send error report once
    No

Expected behavior

An error, but an expected one. We'll get lots of error reports otherwise.

Environment & setup

Environment variables loaded from /Users/m/Go/src/github.com/prisma/qa/.env
@prisma/cli          : 2.11.0-dev.43
@prisma/client       : 2.11.0-dev.43
Current platform     : darwin
Query Engine         : query-engine a624a6628b9e5e453bb8f8cb0460e233a3a97e62 (at node_modules/@prisma/engines/query-engine-darwin)
Migration Engine     : migration-engine-cli a624a6628b9e5e453bb8f8cb0460e233a3a97e62 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core a624a6628b9e5e453bb8f8cb0460e233a3a97e62 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary        : prisma-fmt a624a6628b9e5e453bb8f8cb0460e233a3a97e62 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Studio               : 0.308.0
Preview Features     : nativeTypes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: migrate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants