schema: revert incorrect removal of oauth changes in #7417 (#8245)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql b/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
index c79e99c..61f03be 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
@@ -196,3 +196,31 @@
ADD COLUMN `error_str` varchar(255) DEFAULT NULL COMMENT 'the error message when the snapshot download occurs' AFTER `download_pct`,
ADD COLUMN `local_path` varchar(255) DEFAULT NULL COMMENT 'the path of the snapshot download' AFTER `error_str`,
ADD COLUMN `display` tinyint(1) unsigned NOT NULL DEFAULT 1 COMMENT '1 implies store reference is available for listing' AFTER `error_str`;
+
+UPDATE `cloud`.`configuration` SET
+ `options` = concat(`options`, ',OAUTH2'),
+ `default_value` = concat(`default_value`, ',OAUTH2'),
+ `value` = concat(`value`, ',OAUTH2')
+WHERE `name` = 'user.authenticators.order' ;
+
+UPDATE `cloud`.`configuration` SET
+ `options` = concat(`options`, ',OAUTH2Auth'),
+ `default_value` = concat(`default_value`, ',OAUTH2Auth'),
+ `value` = concat(`value`, ',OAUTH2Auth')
+where `name` = 'pluggableApi.authenticators.order' ;
+
+-- Create table for OAuth provider details
+DROP TABLE IF EXISTS `cloud`.`oauth_provider`;
+CREATE TABLE `cloud`.`oauth_provider` (
+ `id` bigint unsigned NOT NULL auto_increment COMMENT 'id',
+ `uuid` varchar(40) NOT NULL COMMENT 'unique identifier',
+ `description` varchar(1024) COMMENT 'description of the provider',
+ `provider` varchar(40) NOT NULL COMMENT 'name of the provider',
+ `client_id` varchar(255) NOT NULL COMMENT 'client id which is configured in the provider',
+ `secret_key` varchar(255) NOT NULL COMMENT 'secret key which is configured in the provider',
+ `redirect_uri` varchar(255) NOT NULL COMMENT 'redirect uri which is configured in the provider',
+ `enabled` int(1) NOT NULL DEFAULT 1 COMMENT 'Enabled or disabled',
+ `created` datetime NOT NULL COMMENT 'date created',
+ `removed` datetime COMMENT 'date removed if not null',
+ PRIMARY KEY (`id`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;