Skip to content

Commit 728410a

Browse files
angelok1srmoore
authored andcommitted
Fixed broken scripts from schema change on system_scope
1 parent 6a00750 commit 728410a

File tree

5 files changed

+34
-40
lines changed

5 files changed

+34
-40
lines changed

openid-connect-server-webapp/src/main/resources/db/mysql/scopes.sql

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ START TRANSACTION;
1010
-- Insert scope information into the temporary tables.
1111
--
1212

13-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
14-
('openid', 'log in using your identity', 'user', false, true, false, null),
15-
('profile', 'basic profile information', 'list-alt', false, true, false, null),
16-
('email', 'email address', 'envelope', false, true, false, null),
17-
('address', 'physical address', 'home', false, true, false, null),
18-
('phone', 'telephone number', 'bell', false, true, false, null),
19-
('offline_access', 'offline access', 'time', false, false, false, null);
13+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
14+
('openid', 'log in using your identity', 'user', false, true),
15+
('profile', 'basic profile information', 'list-alt', false, true),
16+
('email', 'email address', 'envelope', false, true),
17+
('address', 'physical address', 'home', false, true),
18+
('phone', 'telephone number', 'bell', false, true),
19+
('offline_access', 'offline access', 'time', false, false);
2020

2121
--
2222
-- Merge the temporary scopes safely into the database. This is a two-step process to keep scopes from being created on every startup with a persistent store.
@@ -28,4 +28,4 @@ INSERT INTO system_scope (scope, description, icon, restricted, default_scope, s
2828

2929
COMMIT;
3030

31-
SET AUTOCOMMIT = 1;
31+
SET AUTOCOMMIT = 1;

openid-connect-server-webapp/src/main/resources/db/oracle/oracle_database_tables.sql

+2-5
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,11 @@ CREATE TABLE system_scope (
255255
description VARCHAR2(4000),
256256
icon VARCHAR2(256),
257257
restricted NUMBER(1) DEFAULT 0 NOT NULL,
258-
default_scope NUMBER(1) DEFAULT 0 NOT NULL,
259-
structured NUMBER(1) DEFAULT 0 NOT NULL,
260-
structured_param_description VARCHAR2(256),
258+
default_scope NUMBER(1) DEFAULT 0 NOT NULL
261259

262260
CONSTRAINT system_scope_unique UNIQUE (scope),
263261
CONSTRAINT default_scope_check CHECK (default_scope in (1,0)),
264-
CONSTRAINT restricted_check CHECK (restricted in (1,0)),
265-
CONSTRAINT structured_check CHECK (structured in (1,0))
262+
CONSTRAINT restricted_check CHECK (restricted in (1,0))
266263
);
267264
CREATE SEQUENCE system_scope_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
268265

openid-connect-server-webapp/src/main/resources/db/oracle/scopes_oracle.sql

+15-16
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@
22
-- Insert scope information into the temporary tables.
33
--
44

5-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
6-
('openid', 'log in using your identity', 'user', 0, 1, 0, null);
7-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
8-
('profile', 'basic profile information', 'list-alt', 0, 1, 0, null);
9-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
10-
('email', 'email address', 'envelope', 0, 1, 0, null);
11-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
12-
('address', 'physical address', 'home', 0, 1, 0, null);
13-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
14-
('phone', 'telephone number', 'bell', 0, 1, 0, null);
15-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
16-
('offline_access', 'offline access', 'time', 0, 0, 0, null);
17-
5+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
6+
('openid', 'log in using your identity', 'user', 0, 1);
7+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
8+
('profile', 'basic profile information', 'list-alt', 0, 1);
9+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
10+
('email', 'email address', 'envelope', 0, 1);
11+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
12+
('address', 'physical address', 'home', 0, 1);
13+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
14+
('phone', 'telephone number', 'bell', 0, 1, 0);
15+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
16+
('offline_access', 'offline access', 'time', 0, 0);
1817
--
1918
-- Merge the temporary scopes safely into the database. This is a two-step process to keep scopes from being created on every startup with a persistent store.
2019
--
2120

2221
MERGE INTO system_scope
23-
USING (SELECT scope, description, icon, restricted, default_scope, structured, structured_param_description FROM system_scope_TEMP) vals
22+
USING (SELECT scope, description, icon, restricted, default_scope FROM system_scope_TEMP) vals
2423
ON (vals.scope = system_scope.scope)
2524
WHEN NOT MATCHED THEN
26-
INSERT (id, scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES(system_scope_seq.nextval, vals.scope,
27-
vals.description, vals.icon, vals.restricted, vals.default_scope, vals.structured, vals.structured_param_description);
25+
INSERT (id, scope, description, icon, restricted, default_scope) VALUES(system_scope_seq.nextval, vals.scope,
26+
vals.description, vals.icon, vals.restricted, vals.default_scope);

openid-connect-server-webapp/src/main/resources/db/psql/psql_database_tables.sql

-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,6 @@ CREATE TABLE IF NOT EXISTS system_scope (
239239
icon VARCHAR(256),
240240
restricted BOOLEAN DEFAULT false NOT NULL,
241241
default_scope BOOLEAN DEFAULT false NOT NULL,
242-
structured BOOLEAN DEFAULT false NOT NULL,
243-
structured_param_description VARCHAR(256),
244242
UNIQUE (scope)
245243
);
246244

openid-connect-server-webapp/src/main/resources/db/psql/scopes.sql

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ START TRANSACTION;
1010
-- Insert scope information into the temporary tables.
1111
--
1212

13-
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
14-
('openid', 'log in using your identity', 'user', false, true, false, null),
15-
('profile', 'basic profile information', 'list-alt', false, true, false, null),
16-
('email', 'email address', 'envelope', false, true, false, null),
17-
('address', 'physical address', 'home', false, true, false, null),
18-
('phone', 'telephone number', 'bell', false, true, false, null),
19-
('offline_access', 'offline access', 'time', false, false, false, null);
13+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
14+
('openid', 'log in using your identity', 'user', false, true),
15+
('profile', 'basic profile information', 'list-alt', false, true),
16+
('email', 'email address', 'envelope', false, true),
17+
('address', 'physical address', 'home', false, true),
18+
('phone', 'telephone number', 'bell', false, true),
19+
('offline_access', 'offline access', 'time', false, false);
2020

2121
--
2222
-- Merge the temporary scopes safely into the database. This is a two-step process to keep scopes from being created on every startup with a persistent store.
2323
--
2424

25-
INSERT INTO system_scope (scope, description, icon, restricted, default_scope, structured, structured_param_description)
26-
SELECT scope, description, icon, restricted, default_scope, structured, structured_param_description FROM system_scope_TEMP
25+
INSERT INTO system_scope (scope, description, icon, restricted, default_scope)
26+
SELECT scope, description, icon, restricted, default_scope FROM system_scope_TEMP
2727
ON CONFLICT(scope)
2828
DO NOTHING;
2929

0 commit comments

Comments
 (0)