CREATE TABLE gtg_sync_state (
    DATASOURCE_ID          NUMBER(5, 0)  ,
    NAME                   VARCHAR2(4000),
    TYPE                   NUMBER(2, 0)  ,
    CHECKSUM               VARCHAR2(256) ,
    LAST_SYNC_TIMESTAMP    TIMESTAMP(6)  ,
    CURRENT_MAX_ID         NUMBER(19, 0) ,
    TOTAL_ROW_COUNT        NUMBER(19, 0) ,
    LAST_UPDATED_BY        VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_DATE       TIMESTAMP(6)      NOT NULL,
    LAST_UPDATE_LOGIN      VARCHAR2(128) ,
    CREATED_BY             VARCHAR2(256)     NOT NULL,
    CREATION_DATE          TIMESTAMP(6)      NOT NULL,
    DATASOURCE_ID          NUMBER(5, 0)  ,
    NAME                   VARCHAR2(4000),
    TYPE                   NUMBER(2, 0)  ,
    CHECKSUM               VARCHAR2(256) ,
    LAST_SYNC_TIMESTAMP    TIMESTAMP(6)  ,
    CURRENT_MAX_ID         NUMBER(19, 0) ,
    TOTAL_ROW_COUNT        NUMBER(19, 0) ,
    LAST_UPDATED_BY        VARCHAR2(256)     NOT NULL,
    LAST_UPDATE_DATE       TIMESTAMP(6)      NOT NULL,
    LAST_UPDATE_LOGIN      VARCHAR2(128) ,
    CREATED_BY             VARCHAR2(256)     NOT NULL,
    CREATION_DATE          TIMESTAMP(6)      NOT NULL,
    CONSTRAINT pk_gtg_sync_state PRIMARY KEY (DATASOURCE_ID, NAME, DATASOURCE_ID, NAME)
);
