dolthub / go-mysql-server

A MySQL-compatible relational database with a storage agnostic query engine. Implemented in pure Go.
Apache License 2.0
2.32k stars 199 forks source link

use datetime precision in information_schema.columns.datetime_precision #2610

Closed jycor closed 1 month ago

jycor commented 1 month ago

When determining if a schema change occurred, one of the tables Prisma looks at is the information_schema.columns. Here, we incorrectly mark all datetime and timestamp columns as with a precision of 6. If a table has type DATETIME(3), Prisma would think there was a schema change, and perform a migration when one isn't needed.

This PR addresses this issue by having the information_schema.columns table accurately reflect the datetime preicision of the columns,

fixes: https://github.com/dolthub/dolt/issues/8173