Introspect in 2.11.0 changes all updatedAt properties' types to timestamptz and comments them out
See original GitHub issueBug description
Using the latest release, 2.11.0, introspect will change all updatedAt properties’ types to timestamptz and comment them out.
How to reproduce
Given a PostgreSQL table:
CREATE TABLE IF NOT EXISTS "contact" (
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
"updatedAt" timestamp(6) with time zone NOT NULL DEFAULT now(),
PRIMARY KEY ("id")
);
Model prior to introspection:
model contact {
id String @id @default(dbgenerated())
updatedAt DateTime @default(now()) @updatedAt
Model after introspection:
model contact {
id String @id @default(dbgenerated())
// This type is currently not supported.
// updatedAt timestamptz @default(dbgenerated())
Expected behavior
Expect introspect to not change the schema.
Environment & setup
- OS: Windows
- Database: PostgreSQL
- Node.js version: 12.16.1
- Prisma version: 2.11.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:5 (2 by maintainers)
Top Results From Across the Web
No results found
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
Would it be possible to suppress the warnings with a flag and restore the old behavior? It’s reasonable to warn about the use of timestamptz if they lead to unexpected behavior but for apps that were working before it would be nice to have an upgrade path without having to migrate the database. I would expect a lot of people using postgres would be using timestamptz since their docs explicitly suggest it over timestamp.
Could we just keep the old behavior if user didn’t enable the nativeType preview feature?