   API_ID varchar(255) NOT NULL,
   ARTIFACT blob,
   GATEWAY_INSTRUCTION varchar(20),
-  GATEWAY_LABEL varchar(255),
-  TIME_STAMP TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  GATEWAY_LABEL varchar(255) NOT NULL,
+  TIME_STAMP TIMESTAMP NOT NULL GENERATED ALWAYS FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP,
   PRIMARY KEY (GATEWAY_LABEL, API_ID),
-  FOREIGN KEY (API_ID) REFERENCES AM_GW_PUBLISHED_API_DETAILS(API_ID) ON UPDATE CASCADE ON DELETE NO ACTION
+  FOREIGN KEY (API_ID) REFERENCES AM_GW_PUBLISHED_API_DETAILS(API_ID) ON DELETE NO ACTION
 ) /
 -- End of API-MGT Tables --
 


CREATE TABLE AM_KEY_MANAGER (
  UUID VARCHAR(50) NOT NULL,
  NAME VARCHAR(100) NULL,
  DISPLAY_NAME VARCHAR(100) NULL,
  DESCRIPTION VARCHAR(256) NULL,
  TYPE VARCHAR(45) NULL,
  CONFIGURATION BLOB NULL,
  ENABLED INT NULL,
  TENANT_DOMAIN VARCHAR(100) NULL,
  PRIMARY KEY (UUID),
  UNIQUE (NAME,TENANT_DOMAIN)
)

)/

CREATE TABLE AM_GRAPHQL_COMPLEXITY (
    UUID VARCHAR(256) NOT NULL,
    API_ID INTEGER NOT NULL,
    TYPE VARCHAR(256) NOT NULL,
    FIELD VARCHAR(256) NOT NULL,
    COMPLEXITY_VALUE INTEGER,
    FOREIGN KEY (API_ID) REFERENCES AM_API(API_ID) ON DELETE RESTRICT,
    PRIMARY KEY(UUID),
    UNIQUE (API_ID,TYPE,FIELD)
)/
