These id fields were enriched with `@default(cuid())` information taken from the previous Prisma schema
See original GitHub issueBug description
While in the process of upgrading from prisma 1.13, I usually run introspection after each step. so one warning kept showing even though I don’t think there’s a need for it, correct me please.
How to reproduce
I just run
npx prisma introspect
*** WARNING ***
These id fields were enriched with `@default(cuid())` information taken from the previous Prisma schema.
- Model "A", field: "id"
- Model "B", field: "id"
.
.
.etc
Expected behavior
I think it should not be shown given the schema has actually been enriched
Prisma information
model Item1 {
id String @id @default(cuid()) @db.Char(30)
}
model Item2 {
id String @id @default(cuid()) @db.Char(30)
}
Environment & setup
OS: Ubuntu 18 Database: MySQL 5.7 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Schema Incompatibilities | PostgreSQL - Prisma
Prisma 1 auto-generates ID values as CUIDs for ID fields when they're ... As a workaround, you can manually add the @default(cuid()) attribute...
Read more >Data model (Reference) - Prisma
Learn about the concepts for building your data model with Prisma: Models, scalar types, enums, attributes, functions, IDs, default values and more.
Read more >Prisma schema API (Reference)
In most cases, you want your database to create the ID. To do this, annotate the ID field with the @default attribute and...
Read more >Upgrading the Prisma layer to Prisma 2 | PostgreSQL
With Prisma 2, this information is now specified inside the Prisma schema via ... @default(cuid()) for your @id fields; @updatedAt for any fields...
Read more >What is introspection? (Reference) - Prisma
Learn how you can introspect your database to generate a data model into your Prisma schema.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@Jolg42 doing that I lost the following attributes from the schema:
Also relation fields names have changed to their models names, like reporter changed to AbuseReporter camelcase.
It basically messes the whole schema up and I have to go through the 700 lines schema line by line to fix the issues.
So I have no choice but to undo the --force
They mentioned something about using the
@default(cuid())and@updatedAtattributes here: https://www.prisma.io/docs/guides/upgrade-guides/upgrade-from-prisma-1/schema-incompatibilities-postgres#manually-add-the-updatedat-attribute-to-the-prisma-modelThey’re well-known problems and are seen/provided as workarounds.