Open divyenduz opened 4 years ago
A potential solution in
test-utils
can be to cap all date time types to the smaller date time range of all the underlying types
That sounds like the right thing to do here. Creating timestamps in that date range should be simple enough.
A potential solution in test-utils can be to cap all date time types to the smaller date time range of all the underlying types
Added this in a test-utils branch. Update (will move this content to its respective place/issue tomorrow!):
SUCCESS
Invalid response data: the query result was required, but an empty Object((Weak)) was returned instead.
ConversionError(Custom { kind: InvalidData, error: "DateTime value not stored as datetime, int or text"
ForeignKeyConstraintViolation { constraint: Fields(["page_id"]) } })
Looks like this issue is effectively resolved.
According to the MySQL docs:
The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.
test-utils
however is not aware of this limitation as this information is lost in the Prisma schema (timestamp
is mapped to Prisma typeDateTime
).A potential solution in
test-utils
can be to cap all date time types to the smaller date time range of all the underlying types (in my understanding that is indeed timestamp)Internal notes:
Test utils database(s) affected:
Related issue: https://github.com/prisma/prisma-test-utils/issues/20
I don't know how Jan was able to make Sakila run, in my automated tests, it fails on the generate step. The underlying field there is
timestamp
but the error is slightly different. Maybe it morphed.