Introspected CockroachDB schema has different field type than original Prisma schema that was migrated
See original GitHub issuehttps://github.com/prisma/migrations-ci/commit/e30759d59b54d1aaf1f8bd7236a71b258c523b76 shows 2 schemas.diff
where the type of a field is different different in the schema introspected from a databases that created based on a first introspected schema of the example database.
- https://github.com/prisma/migrations-ci/commit/e30759d59b54d1aaf1f8bd7236a71b258c523b76#diff-3cfebb6cd03f022a25275af8d5bf5a990572342af05d6515e994d3d21f620ce0 (
results/cockroachdb-serverless/introspection-ci-5134.noalyss-folder/schemas.diff
)
Here we go from a... 190,195c190,195 < ex_enable Unsupported("char") @default(dbgenerated("'Y':::STRING::\"char\"")) --- > ex_enable String @default(dbgenerated("'Y':::STRING::\"char\"")) @db.Char(1) 225,226c225,226 < fi_debit Unsupported("char") @default(dbgenerated("'d':::STRING::\"char\"")) --- > fi_debit String @default(dbgenerated("'d':::STRING::\"char\"")) @db.Char(1)
Unsupported("char")
to aString @db.Char(1)
with an identical@default
Original SQL isex_enable "char" DEFAULT 'Y'::"char" NOT NULL
. - https://github.com/prisma/migrations-ci/commit/e30759d59b54d1aaf1f8bd7236a71b258c523b76#diff-fc00c6eeb3b064b49cdf3509d9dcbb78a5d3818ff28a72412b75e4da485ecc87 (
results/cockroachdb-serverless/introspection-ci-5134.northwind/schemas.diff
)
Here we fo from20,21c20,21 < customer_id String @db.Char < customer_type_id String @db.Char --- > customer_id String @db.Char(1) > customer_type_id String @db.Char(1) 29c29 < customer_type_id String @id(map: "pk_customer_demographics") @db.Char --- > customer_type_id String @id(map: "pk_customer_demographics") @db.Char(1) 35c35 < customer_id String @id(map: "pk_customers") @db.Char --- > customer_id String @id(map: "pk_customers") @db.Char(1) 98c98 < customer_id String? @db.Char --- > customer_id String? @db.Char(1) 135c135 < region_description String @db.Char --- > region_description String @db.Char(1) 164c164 < territory_description String @db.Char --- > territory_description String @db.Char(1)
String @db.Char
toString @db.Char(1)
. Original SQL seems to beterritory_description bpchar NOT NULL,
and similar.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Introspection | typescript-cockroachdb - Prisma
Introspection your database with Prisma. ... For the purpose of this guide, we'll use a demo SQL schema with three tables: CREATE TABLE...
Read more >Prisma schema API (Reference)
API reference documentation for the Prisma Schema Language (PSL). ... String (URL), Connection URL to the shadow database used by Prisma Migrate.
Read more >Data model (Reference) - Prisma
Generate the data model via introspection: When you have an existing database or prefer migrating your database schema with SQL, you generate the...
Read more >Names in the underlying database - Prisma
The Prisma schema includes mechanisms that allow you to define names of certain database objects. You can: Map model and field names to...
Read more >What is introspection? (Reference) - Prisma
Introspection has one main function: Populate your Prisma schema with a data ... using Prisma Migrate, but instead use plain SQL or another...
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 FreeTop 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
Top GitHub Comments
kekw, and then I find the bug from the code. When you come back on Monday @janpio do not read the two comments I wrote above.
Double checked, this is really fixed this time 👍