Skip to content
Snippets Groups Projects
Commit 8134deda authored by Dominik František Bučík's avatar Dominik František Bučík
Browse files

chore: merge branch 'db' into 'main'

fix: :bug: Fix cleanup savedUserAuth

See merge request !381
parents 1790d3d9 5d559b2d
No related branches found
No related tags found
1 merge request!381fix: 🐛 Fix cleanup savedUserAuth
Pipeline #409218 passed
...@@ -173,6 +173,9 @@ CREATE TABLE IF NOT EXISTS client_details ( ...@@ -173,6 +173,9 @@ CREATE TABLE IF NOT EXISTS client_details (
code_challenge_method VARCHAR(256), code_challenge_method VARCHAR(256),
parent_client_id BIGINT DEFAULT NULL, parent_client_id BIGINT DEFAULT NULL,
accepted_tos BOOLEAN DEFAULT false,
jurisdiction VARCHAR(256) DEFAULT NULL,
UNIQUE (client_id) UNIQUE (client_id)
); );
...@@ -289,7 +292,8 @@ CREATE TABLE IF NOT EXISTS device_code ( ...@@ -289,7 +292,8 @@ CREATE TABLE IF NOT EXISTS device_code (
expiration TIMESTAMP NULL, expiration TIMESTAMP NULL,
client_id VARCHAR(256), client_id VARCHAR(256),
approved BOOLEAN, approved BOOLEAN,
auth_holder_id BIGINT auth_holder_id BIGINT,
recorded_error TEXT DEFAULT NULL
); );
CREATE TABLE IF NOT EXISTS device_code_scope ( CREATE TABLE IF NOT EXISTS device_code_scope (
...@@ -303,6 +307,14 @@ CREATE TABLE IF NOT EXISTS device_code_request_parameter ( ...@@ -303,6 +307,14 @@ CREATE TABLE IF NOT EXISTS device_code_request_parameter (
val VARCHAR(2048) val VARCHAR(2048)
); );
CREATE TABLE shedlock (
name VARCHAR(64) PRIMARY KEY,
lock_until TIMESTAMP(3) NULL,
locked_at TIMESTAMP(3) NULL,
locked_by VARCHAR(255)
);
alter table access_token alter table access_token
add constraint access_token_authentication_holder_id_fk add constraint access_token_authentication_holder_id_fk
foreign key (auth_holder_id) references authentication_holder (id) foreign key (auth_holder_id) references authentication_holder (id)
......
...@@ -143,7 +143,7 @@ public class CustomClearTasks { ...@@ -143,7 +143,7 @@ public class CustomClearTasks {
manager.clear(); manager.clear();
int count = 0; int count = 0;
Query query = manager.createQuery("DELETE FROM SavedUserAuthentication sa " + Query query = manager.createQuery("DELETE FROM SavedUserAuthentication sa " +
"WHERE sa.id NOT IN (SELECT ah.userAuth FROM AuthenticationHolderEntity ah)"); "WHERE sa.id NOT IN (SELECT ah.userAuth.id FROM AuthenticationHolderEntity ah)");
if (timeout > 0) { if (timeout > 0) {
query.setHint(HINT_TIMEOUT, timeout); query.setHint(HINT_TIMEOUT, timeout);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment