CREATE TABLE AM_API_CATEGORIES (
  UUID VARCHAR2(50),
  NAME VARCHAR2(255) NOT NULL,
  DESCRIPTION VARCHAR2(1024),
  TENANT_ID INTEGER DEFAULT -1,
  UNIQUE (NAME,TENANT_ID),
  PRIMARY KEY (UUID)
)
/

ALTER TABLE AM_SYSTEM_APPS
ADD TENANT_DOMAIN VARCHAR2(255) DEFAULT 'carbon.super'
/

ALTER TABLE AM_SYSTEM_APPS
DROP UNIQUE (NAME)
/

CREATE TABLE AM_USER (
    USER_ID VARCHAR(255) NOT NULL,
    USER_NAME VARCHAR(255) NOT NULL,
    PRIMARY KEY(USER_ID)
)
/

CREATE TABLE AM_SECURITY_AUDIT_UUID_MAPPING (
    API_ID INTEGER NOT NULL,
    AUDIT_UUID VARCHAR(255) NOT NULL,
    PRIMARY KEY (API_ID),
    FOREIGN KEY (API_ID) REFERENCES AM_API(API_ID)
)
/