From 673363b2effc911bb3de11b9a7f4e18a4079e161 Mon Sep 17 00:00:00 2001 From: BLasan Date: Fri, 20 Sep 2024 08:25:20 +0530 Subject: [PATCH] Add: Composite Primary Key --- .../src/main/resources/sql/mysql.sql | 2 +- .../src/main/resources/sql/oracle.sql | 2 +- .../src/main/resources/sql/oracle_23c.sql | 2 +- .../src/main/resources/sql/oracle_rac.sql | 2 +- .../src/main/resources/sql/postgresql.sql | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/mysql.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/mysql.sql index 6c3263a53985..da32362534b5 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/mysql.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/mysql.sql @@ -1529,7 +1529,7 @@ CREATE TABLE IF NOT EXISTS AM_API_SEQUENCE_BACKEND ( SEQUENCE LONGBLOB NOT NULL, NAME VARCHAR(256) NOT NULL, TYPE VARCHAR(120) NOT NULL, - PRIMARY KEY (ID), + PRIMARY KEY (ID,API_UUID,REVISION_UUID,TYPE), FOREIGN KEY (API_UUID) REFERENCES AM_API(API_UUID) ON DELETE CASCADE )ENGINE INNODB; diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle.sql index a7806e44f28c..307426eeddd5 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle.sql @@ -3460,7 +3460,7 @@ CREATE TABLE AM_API_SEQUENCE_BACKEND ( SEQUENCE BLOB NOT NULL, NAME VARCHAR2(256) NOT NULL, TYPE VARCHAR2(120) NOT NULL, - PRIMARY KEY (ID), + PRIMARY KEY (ID,API_UUID,REVISION_UUID,TYPE), FOREIGN KEY (API_UUID) REFERENCES AM_API(API_UUID) ON DELETE CASCADE ) / diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_23c.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_23c.sql index e68971f1f145..9e652ee4f267 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_23c.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_23c.sql @@ -2476,7 +2476,7 @@ CREATE TABLE AM_API_SEQUENCE_BACKEND ( SEQUENCE BLOB NOT NULL, NAME VARCHAR2(256) NOT NULL, TYPE VARCHAR2(120) NOT NULL, - PRIMARY KEY (ID), + PRIMARY KEY (ID,API_UUID,REVISION_UUID,TYPE), FOREIGN KEY (API_UUID) REFERENCES AM_API(API_UUID) ON DELETE CASCADE ) / diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_rac.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_rac.sql index 32f23e6c16ef..143b6bba6667 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_rac.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/oracle_rac.sql @@ -2466,7 +2466,7 @@ CREATE TABLE AM_API_SEQUENCE_BACKEND ( SEQUENCE BLOB NOT NULL, NAME VARCHAR2(256) NOT NULL, TYPE VARCHAR2(120) NOT NULL, - PRIMARY KEY (ID), + PRIMARY KEY (ID,API_UUID,REVISION_UUID,TYPE), FOREIGN KEY (API_UUID) REFERENCES AM_API(API_UUID) ON DELETE CASCADE ) / diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/postgresql.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/postgresql.sql index b27087f079b5..c66361c622c4 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/postgresql.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/sql/postgresql.sql @@ -1865,7 +1865,7 @@ CREATE TABLE IF NOT EXISTS AM_API_SEQUENCE_BACKEND ( SEQUENCE BYTEA NOT NULL, NAME VARCHAR(256) NOT NULL, TYPE VARCHAR(120) NOT NULL, - PRIMARY KEY (ID), + PRIMARY KEY (ID,API_UUID,REVISION_UUID,TYPE), FOREIGN KEY (API_UUID) REFERENCES AM_API(API_UUID) ON DELETE CASCADE );