From 2422a7542178e6cf6688da8378161260a8302f38 Mon Sep 17 00:00:00 2001 From: Ainur Date: Fri, 13 Oct 2023 17:14:47 +0200 Subject: [PATCH] CB-3778 schemas fix --- .../io.cloudbeaver.service.security/db/cb_schema_create.sql | 2 +- .../db/cb_schema_update_10.sql | 2 +- .../db/cb_schema_update_13.sql | 2 +- .../io.cloudbeaver.service.security/db/cb_schema_update_2.sql | 2 +- .../io.cloudbeaver.service.security/db/cb_schema_update_5.sql | 2 +- .../io.cloudbeaver.service.security/db/cb_schema_update_7.sql | 4 ++-- .../io.cloudbeaver.service.security/db/cb_schema_update_9.sql | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_create.sql b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_create.sql index 2896c125c2..febb3482c3 100644 --- a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_create.sql +++ b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_create.sql @@ -308,7 +308,7 @@ CREATE TABLE {table_prefix}CB_USER_SECRETS SECRET_LABEL VARCHAR(128), SECRET_DESCRIPTION VARCHAR(1024), - ENCODING_TYPE VARCHAR(32) NOT NULL DEFAULT 'PLAINTEXT', + ENCODING_TYPE VARCHAR(32) DEFAULT 'PLAINTEXT' NOT NULL, UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (USER_ID, SECRET_ID), diff --git a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_10.sql b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_10.sql index 7fdc12e8d0..8d1d44cf82 100644 --- a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_10.sql +++ b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_10.sql @@ -7,7 +7,7 @@ CREATE TABLE {table_prefix}CB_USER_SECRETS SECRET_LABEL VARCHAR(128), SECRET_DESCRIPTION VARCHAR(1024), - UPDATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (USER_ID, SECRET_ID), FOREIGN KEY (USER_ID) REFERENCES {table_prefix}CB_USER (USER_ID) ON DELETE CASCADE diff --git a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_13.sql b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_13.sql index 843ab47a31..200cc664ea 100644 --- a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_13.sql +++ b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_13.sql @@ -1,2 +1,2 @@ ALTER TABLE {table_prefix}CB_USER_SECRETS - ADD COLUMN ENCODING_TYPE VARCHAR(32) NOT NULL DEFAULT 'PLAINTEXT'; \ No newline at end of file + ADD COLUMN ENCODING_TYPE VARCHAR(32) DEFAULT 'PLAINTEXT' NOT NULL; \ No newline at end of file diff --git a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_2.sql b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_2.sql index ee14af9683..fbffddcab3 100644 --- a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_2.sql +++ b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_2.sql @@ -55,7 +55,7 @@ CREATE TABLE IF NOT EXISTS {table_prefix}CB_WORKSPACE( FOREIGN KEY(INSTANCE_ID) REFERENCES {table_prefix}CB_INSTANCE(INSTANCE_ID) ); -ALTER TABLE {table_prefix}CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; +ALTER TABLE {table_prefix}CB_USER_CREDENTIALS ADD UPDATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL; ALTER TABLE {table_prefix}CB_SESSION ALTER COLUMN LAST_ACCESS_REMOTE_ADDRESS VARCHAR(128) NULL; ALTER TABLE {table_prefix}CB_SESSION ALTER COLUMN LAST_ACCESS_USER_AGENT VARCHAR(255) NULL; diff --git a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_5.sql b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_5.sql index c15cbf971c..b7ccc68097 100644 --- a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_5.sql +++ b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_5.sql @@ -5,7 +5,7 @@ CREATE TABLE {table_prefix}CB_AUTH_TOKEN USER_ID VARCHAR(128), EXPIRATION_TIME TIMESTAMP NOT NULL, - CREATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + CREATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (TOKEN_ID), FOREIGN KEY (SESSION_ID) REFERENCES {table_prefix}CB_SESSION (SESSION_ID) ON DELETE CASCADE, diff --git a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_7.sql b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_7.sql index 410597bc0e..64cb9ca652 100644 --- a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_7.sql +++ b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_7.sql @@ -8,7 +8,7 @@ CREATE TABLE {table_prefix}CB_AUTH_ATTEMPT SESSION_TYPE VARCHAR(64) NOT NULL, APP_SESSION_STATE TEXT NOT NULL, - CREATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + CREATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (AUTH_ID), FOREIGN KEY (SESSION_ID) REFERENCES {table_prefix}CB_SESSION (SESSION_ID) ON DELETE CASCADE @@ -21,7 +21,7 @@ CREATE TABLE {table_prefix}CB_AUTH_ATTEMPT_INFO AUTH_PROVIDER_CONFIGURATION_ID VARCHAR(128), AUTH_STATE TEXT NOT NULL, - CREATE_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + CREATE_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, PRIMARY KEY (AUTH_ID, AUTH_PROVIDER_ID), FOREIGN KEY (AUTH_ID) REFERENCES {table_prefix}CB_AUTH_ATTEMPT (AUTH_ID) ON DELETE CASCADE diff --git a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_9.sql b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_9.sql index ca028aabbc..a6c7e3e712 100644 --- a/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_9.sql +++ b/server/bundles/io.cloudbeaver.service.security/db/cb_schema_update_9.sql @@ -2,4 +2,4 @@ ALTER TABLE {table_prefix}CB_AUTH_TOKEN ADD REFRESH_TOKEN_ID VARCHAR(128); ALTER TABLE {table_prefix}CB_AUTH_TOKEN - ADD REFRESH_TOKEN_EXPIRATION_TIME TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; \ No newline at end of file + ADD REFRESH_TOKEN_EXPIRATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL; \ No newline at end of file