From 3e4c6599b0956908b795309b33a466dc4be9b0e1 Mon Sep 17 00:00:00 2001 From: dakshina Date: Mon, 4 Nov 2024 11:25:47 +0530 Subject: [PATCH] Add AM_TRANSACTION_RECORDS table into multiDC scripts --- .../resources/multi-dc/OGG/oracle/apimgt/tables.sql | 10 ++++++++++ .../multi-dc/OGG/oracle/apimgt/tables_23c.sql | 10 ++++++++++ .../resources/multi-dc/Postgresql/apimgt/tables.sql | 11 +++++++++++ .../multi-dc/SQLServer/mssql/apimgt/tables.sql | 10 ++++++++++ .../src/main/resources/sql/oracle_23c.sql | 11 +++++++++++ 5 files changed, 52 insertions(+) diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables.sql index a25604f1e308..27d2e24c8ba8 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables.sql @@ -2352,3 +2352,13 @@ CREATE TABLE AM_API_AI_CONFIGURATION ( FOREIGN KEY (LLM_PROVIDER_UUID) REFERENCES AM_LLM_PROVIDER(UUID) ) / +CREATE TABLE AM_TRANSACTION_RECORDS ( + ID VARCHAR(255) NOT NULL, + HOST VARCHAR2(255), + SERVER_ID VARCHAR2(255), + SERVER_TYPE VARCHAR2(20), + COUNT NUMBER NOT NULL, + RECORDED_TIME TIMESTAMP NOT NULL, + PRIMARY KEY (ID) +) +/ diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables_23c.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables_23c.sql index e0e4990dd09f..470a1ce503b7 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables_23c.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/OGG/oracle/apimgt/tables_23c.sql @@ -2352,3 +2352,13 @@ CREATE TABLE AM_API_AI_CONFIGURATION ( FOREIGN KEY (LLM_PROVIDER_UUID) REFERENCES AM_LLM_PROVIDER(UUID) ) / +CREATE TABLE AM_TRANSACTION_RECORDS ( + ID VARCHAR(255) NOT NULL, + HOST VARCHAR2(255), + SERVER_ID VARCHAR2(255), + SERVER_TYPE VARCHAR2(20), + COUNT NUMBER NOT NULL, + RECORDED_TIME TIMESTAMP NOT NULL, + PRIMARY KEY (ID) +) +/ diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/Postgresql/apimgt/tables.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/Postgresql/apimgt/tables.sql index 3acce5eafc83..ff29b309ce0b 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/Postgresql/apimgt/tables.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/Postgresql/apimgt/tables.sql @@ -2881,6 +2881,17 @@ CREATE TABLE IF NOT EXISTS AM_API_AI_CONFIGURATION ( FOREIGN KEY (LLM_PROVIDER_UUID) REFERENCES AM_LLM_PROVIDER(UUID) ); +DROP TABLE IF EXISTS AM_TRANSACTION_RECORDS; +CREATE TABLE IF NOT EXISTS AM_TRANSACTION_RECORDS ( + ID VARCHAR(255) NOT NULL, + HOST VARCHAR(255), + SERVER_ID VARCHAR(255), + SERVER_TYPE VARCHAR(20), + COUNT INT NOT NULL, + RECORDED_TIME TIMESTAMP NOT NULL, + PRIMARY KEY (ID) + ); + -- End of API-MGT Tables -- -- Performance indexes start -- diff --git a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/SQLServer/mssql/apimgt/tables.sql b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/SQLServer/mssql/apimgt/tables.sql index 4226aa48413a..8ce87ce766fe 100644 --- a/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/SQLServer/mssql/apimgt/tables.sql +++ b/features/apimgt/org.wso2.carbon.apimgt.core.feature/src/main/resources/multi-dc/SQLServer/mssql/apimgt/tables.sql @@ -2745,6 +2745,16 @@ CREATE TABLE AM_API_AI_CONFIGURATION ( FOREIGN KEY (API_UUID) REFERENCES AM_API(API_UUID), FOREIGN KEY (LLM_PROVIDER_UUID) REFERENCES AM_LLM_PROVIDER(UUID) ); +IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[AM_TRANSACTION_RECORDS]') AND TYPE IN (N'U')) +CREATE TABLE AM_TRANSACTION_RECORDS ( + ID VARCHAR(255) NOT NULL, + HOST VARCHAR(255), + SERVER_ID VARCHAR(255), + SERVER_TYPE VARCHAR(20), + COUNT INT NOT NULL, + RECORDED_TIME DATETIME NOT NULL, + PRIMARY KEY (ID) +); --Performance indexes start-- 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 f597a9b74194..59046ee60d45 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 @@ -3879,6 +3879,17 @@ CREATE TABLE AM_API_AI_CONFIGURATION ( ) / +CREATE TABLE AM_TRANSACTION_RECORDS ( + ID VARCHAR(255) NOT NULL, + HOST VARCHAR2(255), + SERVER_ID VARCHAR2(255), + SERVER_TYPE VARCHAR2(20), + COUNT NUMBER NOT NULL, + RECORDED_TIME TIMESTAMP NOT NULL, + PRIMARY KEY (ID) +) +/ + -- End of API-MGT Tables -- --performance indexes start--