Skip to content

Commit c614cfd

Browse files
committed
1 parent 98e02fa commit c614cfd

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

openidconnect.sql

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,42 @@ CREATE TABLE `whitelisted_site_scope` (
454454
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
455455
/*!40101 SET character_set_client = @saved_cs_client */;
456456

457+
458+
-- ADD PATCH FOR SCOPES
459+
--
460+
-- Turn off autocommit and start a transaction so that we can use the temp tables
461+
--
462+
463+
SET AUTOCOMMIT FALSE;
464+
465+
START TRANSACTION;
466+
467+
--
468+
-- Insert scope information into the temporary tables.
469+
--
470+
471+
INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES
472+
('openid', 'log in using your identity', 'user', false, true, false, null),
473+
('profile', 'basic profile information', 'list-alt', false, true, false, null),
474+
('email', 'email address', 'envelope', false, true, false, null),
475+
('address', 'physical address', 'home', false, true, false, null),
476+
('phone', 'telephone number', 'bell', false, true, false, null),
477+
('offline_access', 'offline access', 'time', false, false, false, null);
478+
479+
--
480+
-- 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.
481+
--
482+
483+
MERGE INTO system_scope
484+
USING (SELECT scope, description, icon, restricted, default_scope, structured, structured_param_description FROM system_scope_TEMP) AS vals(scope, description, icon, restricted, default_scope, structured, structured_param_description)
485+
ON vals.scope = system_scope.scope
486+
WHEN NOT MATCHED THEN
487+
INSERT (scope, description, icon, restricted, default_scope, structured, structured_param_description) VALUES(vals.scope, vals.description, vals.icon, vals.restricted, vals.default_scope, vals.structured, vals.structured_param_description);
488+
489+
COMMIT;
490+
491+
SET AUTOCOMMIT TRUE;
492+
457493
--
458494
-- Dumping events for database 'OpenIDConnect'
459495
--

0 commit comments

Comments
 (0)