From ea034f7d4a7267fd7ca7032a1cc370d73beb7f0b Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Mon, 4 Mar 2013 16:10:32 -0500 Subject: [PATCH] database preload fixed to match new schema --- .../src/main/resources/db/clients.sql | 18 +++++++++--------- .../db/tables/loading_temp_tables.sql | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/openid-connect-server/src/main/resources/db/clients.sql b/openid-connect-server/src/main/resources/db/clients.sql index 4e57b883d..7e7a8a53d 100644 --- a/openid-connect-server/src/main/resources/db/clients.sql +++ b/openid-connect-server/src/main/resources/db/clients.sql @@ -21,11 +21,11 @@ INSERT INTO client_scope_TEMP (owner_id, scope) VALUES ('client', 'phone'), ('client', 'offline_access'); -INSERT INTO redirect_uri_TEMP (owner_id, redirect_uri) VALUES +INSERT INTO client_redirect_uri_TEMP (owner_id, redirect_uri) VALUES ('client', 'http://localhost/'), ('client', 'http://localhost:8080/'); -INSERT INTO authorized_grant_type_TEMP (owner_id, authorized_grant_type) VALUES +INSERT INTO client_grant_type_TEMP (owner_id, grant_type) VALUES ('client', 'authorization_code'), ('client', 'urn:ietf:params:oauth:grant_type:redelegate'), ('client', 'implicit'), @@ -47,17 +47,17 @@ MERGE INTO client_scope WHEN NOT MATCHED THEN INSERT (owner_id, scope) values (vals.id, vals.scope); -MERGE INTO redirect_uri - USING (SELECT id, redirect_uri FROM redirect_uri_TEMP, client_details WHERE client_details.client_id = redirect_uri_TEMP.owner_id) AS vals(id, redirect_uri) - ON vals.id = redirect_uri.owner_id AND vals.redirect_uri = redirect_uri.redirect_uri +MERGE INTO client_redirect_uri + USING (SELECT id, redirect_uri FROM client_redirect_uri_TEMP, client_details WHERE client_details.client_id = client_redirect_uri_TEMP.owner_id) AS vals(id, redirect_uri) + ON vals.id = client_redirect_uri.owner_id AND vals.redirect_uri = client_redirect_uri.redirect_uri WHEN NOT MATCHED THEN INSERT (owner_id, redirect_uri) values (vals.id, vals.redirect_uri); -MERGE INTO authorized_grant_type - USING (SELECT id, authorized_grant_type FROM authorized_grant_type_TEMP, client_details WHERE client_details.client_id = authorized_grant_type_TEMP.owner_id) AS vals(id, authorized_grant_type) - ON vals.id = authorized_grant_type.owner_id AND vals.authorized_grant_type = authorized_grant_type.authorized_grant_type +MERGE INTO client_grant_type + USING (SELECT id, grant_type FROM client_grant_type_TEMP, client_details WHERE client_details.client_id = client_grant_type_TEMP.owner_id) AS vals(id, grant_type) + ON vals.id = client_grant_type.owner_id AND vals.grant_type = client_grant_type.grant_type WHEN NOT MATCHED THEN - INSERT (owner_id, authorized_grant_type) values (vals.id, vals.authorized_grant_type); + INSERT (owner_id, grant_type) values (vals.id, vals.grant_type); -- -- Close the transaction and turn autocommit back on diff --git a/openid-connect-server/src/main/resources/db/tables/loading_temp_tables.sql b/openid-connect-server/src/main/resources/db/tables/loading_temp_tables.sql index bbb5894b6..d9e3dbc66 100644 --- a/openid-connect-server/src/main/resources/db/tables/loading_temp_tables.sql +++ b/openid-connect-server/src/main/resources/db/tables/loading_temp_tables.sql @@ -1,6 +1,6 @@ -- -- Temporary tables used during the bootstrapping process to safely load users and clients. --- These are not needed if you're not using the users.sql file to bootstrap the database. +-- These are not needed if you're not using the users.sql/clients.sql files to bootstrap the database. -- CREATE TEMPORARY TABLE IF NOT EXISTS authorities_TEMP ( @@ -55,14 +55,14 @@ CREATE TEMPORARY TABLE IF NOT EXISTS client_scope_TEMP ( scope VARCHAR(2048) ); -CREATE TEMPORARY TABLE IF NOT EXISTS redirect_uri_TEMP ( +CREATE TEMPORARY TABLE IF NOT EXISTS client_redirect_uri_TEMP ( owner_id VARCHAR(256), redirect_uri VARCHAR(2048) ); -CREATE TEMPORARY TABLE IF NOT EXISTS authorized_grant_type_TEMP ( +CREATE TEMPORARY TABLE IF NOT EXISTS client_grant_type_TEMP ( owner_id VARCHAR(256), - authorized_grant_type VARCHAR(2000) + grant_type VARCHAR(2000) ); CREATE TEMPORARY TABLE IF NOT EXISTS system_scope_TEMP (