Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

PANIC: invalid or out-of-range date for type timestamp #33

Open
divyenduz opened this issue Mar 9, 2020 · 2 comments
Open

PANIC: invalid or out-of-range date for type timestamp #33

divyenduz opened this issue Mar 9, 2020 · 2 comments

Comments

@divyenduz
Copy link

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 type DateTime).

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: #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.

@janpio
Copy link
Contributor

janpio commented Mar 9, 2020

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.

@divyenduz
Copy link
Author

divyenduz commented Mar 12, 2020

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!):


Looks like this issue is effectively resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants