I'm using the link for upgrading WSO2-APIM from 2.1.0 to 2.2.0 version.
While performing step 6-g I came across java.sql.SQLSyntaxErrorException for creating a table IDN_OIDC_REQ_OBJECT_REFERENC.
My all other scripts ran successfully but at the time of executing sql scripts from migration-resources\5.5.0\dbscripts\step1\identity\oracle.sql the issue occurred. This file exist inside zip file given in step 6-a.
When I tried running following sql script manually
CREATE TABLE IDN_OIDC_REQ_OBJECT_REFERENCE (
ID INTEGER,
CONSUMER_KEY_ID INTEGER ,
CODE_ID VARCHAR(255) ,
TOKEN_ID VARCHAR(255) ,
SESSION_DATA_KEY VARCHAR(255),
PRIMARY KEY (ID),
FOREIGN KEY (CONSUMER_KEY_ID) REFERENCES IDN_OAUTH_CONSUMER_APPS(ID) ON DELETE CASCADE,
FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE,
FOREIGN KEY (CODE_ID) REFERENCES IDN_OAUTH2_AUTHORIZATION_CODE(CODE_ID) ON DELETE CASCADE);
into oracle db I got following error:
Error at Command Line : 66 Column : 61
Error report -
SQL Error: ORA-02270: no matching unique or primary key for this column-list
02270. 00000 - "no matching unique or primary key for this column-list"
*Cause: A REFERENCES clause in a CREATE/ALTER TABLE statement
gives a column-list for which there is no matching unique or primary
key constraint in the referenced table.
*Action: Find the correct column names using the ALL_CONS_COLUMNS
catalog view
Line 66 is nothing but: FOREIGN KEY (TOKEN_ID) REFERENCES IDN_OAUTH2_ACCESS_TOKEN(TOKEN_ID) ON DELETE CASCADE,
Let me know what thing I've missed while doing the migration ? Or is it because of existing table are not proper ? Any help will be grateful. Thanks in advance.