Add comments to SQL-scripts to ensure robust timezone handling

Issue https://github.com/spring-projects/spring-authorization-server/pull/2217
This commit is contained in:
Joe Grandja 2025-10-20 07:12:50 -04:00
parent fc8b6b5863
commit 22cbb13f7d
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,11 @@
/*
IMPORTANT:
If using PostgreSQL:
- update ALL columns defined with 'timestamp' to 'timestamptz', to ensure that time instants are stored accurately.
If using MySQL:
- add 'preserveInstants=true&connectionTimeZone=UTC&forceConnectionTimeZoneToSession=true' to JDBC connection URL
to ensure that time instants are stored accurately. See https://dev.mysql.com/doc/connector-j/en/connector-j-time-instants.html
*/
CREATE TABLE oauth2_registered_client ( CREATE TABLE oauth2_registered_client (
id varchar(100) NOT NULL, id varchar(100) NOT NULL,
client_id varchar(100) NOT NULL, client_id varchar(100) NOT NULL,

View File

@ -1,7 +1,11 @@
/* /*
IMPORTANT: IMPORTANT:
If using PostgreSQL, update ALL columns defined with 'blob' to 'text', If using PostgreSQL:
as PostgreSQL does not support the 'blob' data type. - update ALL columns defined with 'blob' to 'text', as PostgreSQL does not support the 'blob' data type.
- update ALL columns defined with 'timestamp' to 'timestamptz', to ensure that time instants are stored accurately.
If using MySQL:
- add 'preserveInstants=true&connectionTimeZone=UTC&forceConnectionTimeZoneToSession=true' to JDBC connection URL
to ensure that time instants are stored accurately. See https://dev.mysql.com/doc/connector-j/en/connector-j-time-instants.html
*/ */
CREATE TABLE oauth2_authorization ( CREATE TABLE oauth2_authorization (
id varchar(100) NOT NULL, id varchar(100) NOT NULL,