Replies: 2 comments
-
i Think its a really good idea to start thinking about it! And similar note even the use of "year" in migration, in mySQL it uses the type YEAR which is a set timeframe between '1901' and '2155', which is a big interval but still limited if you are talking about e.a referring to history, or developing a game which is set in the future, then it will be sql error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sounds good. The change is minimal, although you can already do this yourself as the methods involved are simple shortcuts. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Timestamp columns cannot store values past 2038, meaning in ~16 years, applications will break unless all created_at and updated_at columns are switched to DateTime (instead of the default which is Timestamp)
It will also affect user-inputted columns (eg a "Invoice Date", or "Send Mail At", field.. just to make up some examples).. Lets say in December 2037 I want to schedule an email for dispatch in 2038, and my application stores the email campaigns schedule as Timestamp, then I'll encounter an exception.
Therefor I propose, in next major version, to make the Laravel created_at & updated_at columns with type DateTime instead.
I am aware that this is in the far future, however the longer we wait, the higher the migration burden will be.
Open for discussion as well! If theres positive response, I can submit a PR to make the change.
This could (?) also affect other DB engines, however I do not know. Feel free to add that info here so the PR can reflect that.
Additional reading:
https://database.guide/what-is-the-year-2038-problem/
https://laracasts.com/discuss/channels/laravel/migrations-timestamp-vs-datetime-vs-date-vs-timestamps
Beta Was this translation helpful? Give feedback.
All reactions