Skip to content

Commit 94fe58e

Browse files
whelephjgrandja
authored andcommitted
Add comments to SQL-scripts to ensure robust timezone handling
Closes gh-2217 Signed-off-by: wheleph <[email protected]>
1 parent 4a3a1ba commit 94fe58e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

oauth2-authorization-server/src/main/resources/org/springframework/security/oauth2/server/authorization/client/oauth2-registered-client-schema.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
IMPORTANT:
3+
If using PostgreSQL:
4+
- update ALL columns defined with 'timestamp' to 'timestamptz', to ensure that time instants are stored accurately.
5+
If using MySQL:
6+
- add 'preserveInstants=true&connectionTimeZone=UTC&forceConnectionTimeZoneToSession=true' to JDBC connection URL
7+
to ensure that time instants are stored accurately. See https://dev.mysql.com/doc/connector-j/en/connector-j-time-instants.html
8+
*/
19
CREATE TABLE oauth2_registered_client (
210
id varchar(100) NOT NULL,
311
client_id varchar(100) NOT NULL,

oauth2-authorization-server/src/main/resources/org/springframework/security/oauth2/server/authorization/oauth2-authorization-schema.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
/*
22
IMPORTANT:
3-
If using PostgreSQL, update ALL columns defined with 'blob' to 'text',
4-
as PostgreSQL does not support the 'blob' data type.
3+
If using PostgreSQL:
4+
- update ALL columns defined with 'blob' to 'text', as PostgreSQL does not support the 'blob' data type.
5+
- update ALL columns defined with 'timestamp' to 'timestamptz', to ensure that time instants are stored accurately.
6+
If using MySQL:
7+
- add 'preserveInstants=true&connectionTimeZone=UTC&forceConnectionTimeZoneToSession=true' to JDBC connection URL
8+
to ensure that time instants are stored accurately. See https://dev.mysql.com/doc/connector-j/en/connector-j-time-instants.html
59
*/
610
CREATE TABLE oauth2_authorization (
711
id varchar(100) NOT NULL,

0 commit comments

Comments
 (0)