adonisjs / lucid

AdonisJS SQL ORM. Supports PostgreSQL, MySQL, MSSQL, Redshift, SQLite and many more
https://lucid.adonisjs.com/
MIT License
1.07k stars 191 forks source link

fix(migrations): change stubs to not use TZ #965

Closed RomainLanz closed 11 months ago

RomainLanz commented 12 months ago

Hey there! 👋🏻

This PR removes the usage of timestamptz for the default created_at and updated_at fields. It does not really make sense to use a "timezoned" date for those two fields.

thetutlage commented 11 months ago
Screenshot 2023-10-11 at 4 51 07 PM

This is the difference between timestamp and timestampz in PostgreSQL for this article. https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-timestamp/

Are we facing any issues in using timestampz by default?

RomainLanz commented 11 months ago

The distinction between timestamp and timestampz in PostgreSQL lies in the display of timezone information. While timestampz includes timezone data, it can be unnecessary and even counterproductive for those fields handled by the framework, especially considering AdonisJS defaults to UTC.

RomainLanz commented 11 months ago

After an internal discussion. We will end up dropping this PR to avoid a new breaking change for the next release of Lucid.