Skip to content

[Re-Introspection] Keep @updatedAt #3335

@divyenduz

Description

@divyenduz

Bug description

ReIntrospection doesn't retain @updatedAt attribute.

How to reproduce

  1. schema.prisma
model User {
  id String @id
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}
  1. Either migrate or use the following SQL
CREATE TABLE `User` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `createdAt` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
  `updatedAt` datetime(3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  1. Run prisma introspect --experimental-reintrospection

  2. The @updatedAt attribute is lost.

Internal repo: https://github.com/prisma/re-introspection-ci/tree/master/re-introspection-analysis/output/mysql_private/migrate-default-updated-at

Expected behavior

@updatedAt should be retained.

Prisma information

Prisma CLI: 2.5.0-dev.67

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions