Skip to content

Commit

Permalink
Merge pull request #3330 from DMHP/scripts
Browse files Browse the repository at this point in the history
Fix error occur during the migration from WSO2IS-5.3.0 to WSO2IS-5.5.0
  • Loading branch information
DMHP authored Jun 26, 2018
2 parents 208a764 + 8c1f87a commit 114e795
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
BEGIN
DECLARE CONTINUE HANDLER FOR SQLSTATE '42704'
BEGIN END;
EXECUTE IMMEDIATE 'DROP INDEX IDX_AT';
END
/

BEGIN
DECLARE CONTINUE HANDLER FOR SQLSTATE '42704'
BEGIN END;
EXECUTE IMMEDIATE 'DROP INDEX IDX_AUTHORIZATION_CODE';
END
/
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN ALTER COLUMN REFRESH_TOKEN SET DATA TYPE VARCHAR(2048)
/
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN ALTER COLUMN ACCESS_TOKEN SET DATA TYPE VARCHAR(2048)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DROP INDEX IF EXISTS IDX_AT ON IDN_OAUTH2_ACCESS_TOKEN;
DROP INDEX IF EXISTS IDX_AUTHORIZATION_CODE ON IDN_OAUTH2_AUTHORIZATION_CODE;
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify REFRESH_TOKEN VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify ACCESS_TOKEN VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_AUTHORIZATION_CODE modify AUTHORIZATION_CODE VARCHAR(2048);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
IF EXISTS (SELECT * FROM sys.indexes WHERE name='IDX_AT') begin DROP INDEX IDN_OAUTH2_ACCESS_TOKEN.IDX_AT; end;
IF EXISTS (SELECT * FROM sys.indexes WHERE name='IDX_AUTHORIZATION_CODE') begin DROP INDEX IDN_OAUTH2_AUTHORIZATION_CODE.IDX_AUTHORIZATION_CODE; end;
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN ALTER COLUMN ACCESS_TOKEN VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN ALTER COLUMN REFRESH_TOKEN VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_AUTHORIZATION_CODE ALTER COLUMN AUTHORIZATION_CODE VARCHAR(2048);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DROP INDEX IDX_AT ON IDN_OAUTH2_ACCESS_TOKEN;
DROP INDEX IDX_AUTHORIZATION_CODE ON IDN_OAUTH2_AUTHORIZATION_CODE;
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify REFRESH_TOKEN VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify ACCESS_TOKEN VARCHAR(2048);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DROP INDEX IDX_AT ON IDN_OAUTH2_ACCESS_TOKEN;
DROP INDEX IDX_AUTHORIZATION_CODE ON IDN_OAUTH2_AUTHORIZATION_CODE;
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify REFRESH_TOKEN VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify ACCESS_TOKEN VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_AUTHORIZATION_CODE modify AUTHORIZATION_CODE VARCHAR(2048);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
DECLARE
COUNT_INDEXES INTEGER;
BEGIN
SELECT COUNT(*) INTO COUNT_INDEXES
FROM USER_INDEXES
WHERE INDEX_NAME = 'IDX_AT';

IF COUNT_INDEXES > 0 THEN
EXECUTE IMMEDIATE 'DROP INDEX IDX_AT';
END IF;
END;

DECLARE
COUNT_INDEXES INTEGER;
BEGIN
SELECT COUNT(*) INTO COUNT_INDEXES
FROM USER_INDEXES
WHERE INDEX_NAME = 'IDX_AUTHORIZATION_CODE';

IF COUNT_INDEXES > 0 THEN
EXECUTE IMMEDIATE 'DROP INDEX IDX_AUTHORIZATION_CODE';
END IF;
END;

END;
/
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify REFRESH_TOKEN VARCHAR(2048)
/
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN modify ACCESS_TOKEN VARCHAR(2048)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DROP INDEX IF EXISTS IDX_AT;
DROP INDEX IF EXISTS IDX_AUTHORIZATION_CODE;
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN ALTER COLUMN REFRESH_TOKEN TYPE VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_ACCESS_TOKEN ALTER COLUMN ACCESS_TOKEN TYPE VARCHAR(2048);
ALTER TABLE IDN_OAUTH2_AUTHORIZATION_CODE ALTER COLUMN AUTHORIZATION_CODE TYPE VARCHAR(2048);
Expand Down

0 comments on commit 114e795

Please sign in to comment.