CREATE TABLE cse_genealogy_composition (
    ROOT_GEN_OBJECT_ID        NUMBER(18, 0),
    ROOT_ITEM_ID              NUMBER(18, 0),
    ROOT_ORGANIZATION_ID      NUMBER(18, 0),
    ROOT_LOT_NUMBER           VARCHAR2(320),
    ROOT_SERIAL_NUMBER        VARCHAR2(320),
    ROOT_ORIG_DATE            TIMESTAMP(6) ,
    ROOT_ORIG_QUANTITY        NUMBER       ,
    ROOT_ORIG_DOC_TYPE        VARCHAR2(120),
    ROOT_ORIG_DOC_NUMBER      VARCHAR2(960),
    RELATIONSHIP_TYPE_CODE    VARCHAR2(120),
    PARENT_GEN_OBJECT_ID      NUMBER(18, 0),
    PARENT_ITEM_ID            NUMBER(18, 0),
    PARENT_ORGANIZATION_ID    NUMBER(18, 0),
    PARENT_LOT_NUMBER         VARCHAR2(320),
    PARENT_SERIAL_NUMBER      VARCHAR2(320),
    PARENT_ORIG_DATE          TIMESTAMP(6) ,
    PARENT_ORIG_QUANTITY      NUMBER       ,
    PARENT_ORIG_DOC_TYPE      VARCHAR2(120),
    PARENT_ORIG_DOC_NUMBER    VARCHAR2(960),
    CHILD_LEVEL               NUMBER       ,
    CHILD_GEN_OBJECT_ID       NUMBER(18, 0),
    CHILD_ITEM_ID             NUMBER(18, 0),
    CHILD_ORGANIZATION_ID     NUMBER(18, 0),
    CHILD_LOT_NUMBER          VARCHAR2(320),
    CHILD_SERIAL_NUMBER       VARCHAR2(320),
    CHILD_ORIG_DATE           TIMESTAMP(6) ,
    CHILD_ORIG_QUANTITY       NUMBER       ,
    CHILD_ORIG_DOC_TYPE       VARCHAR2(120),
    CHILD_ORIG_DOC_NUMBER     VARCHAR2(960),
    CREATED_BY                VARCHAR2(256)    NOT NULL,
    CREATION_DATE             TIMESTAMP(6)     NOT NULL,
    LAST_UPDATED_BY           VARCHAR2(256)    NOT NULL,
    LAST_UPDATE_DATE          TIMESTAMP(6)     NOT NULL,
    LAST_UPDATE_LOGIN         VARCHAR2(128),
    ROOT_GEN_OBJECT_ID        NUMBER(18, 0),
    ROOT_ITEM_ID              NUMBER(18, 0),
    ROOT_ORGANIZATION_ID      NUMBER(18, 0),
    ROOT_LOT_NUMBER           VARCHAR2(320),
    ROOT_SERIAL_NUMBER        VARCHAR2(320),
    ROOT_ORIG_DATE            TIMESTAMP(6) ,
    ROOT_ORIG_QUANTITY        NUMBER       ,
    ROOT_ORIG_DOC_TYPE        VARCHAR2(120),
    ROOT_ORIG_DOC_NUMBER      VARCHAR2(960),
    RELATIONSHIP_TYPE_CODE    VARCHAR2(120),
    PARENT_GEN_OBJECT_ID      NUMBER(18, 0),
    PARENT_ITEM_ID            NUMBER(18, 0),
    PARENT_ORGANIZATION_ID    NUMBER(18, 0),
    PARENT_LOT_NUMBER         VARCHAR2(320),
    PARENT_SERIAL_NUMBER      VARCHAR2(320),
    PARENT_ORIG_DATE          TIMESTAMP(6) ,
    PARENT_ORIG_QUANTITY      NUMBER       ,
    PARENT_ORIG_DOC_TYPE      VARCHAR2(120),
    PARENT_ORIG_DOC_NUMBER    VARCHAR2(960),
    CHILD_LEVEL               NUMBER       ,
    CHILD_GEN_OBJECT_ID       NUMBER(18, 0),
    CHILD_ITEM_ID             NUMBER(18, 0),
    CHILD_ORGANIZATION_ID     NUMBER(18, 0),
    CHILD_LOT_NUMBER          VARCHAR2(320),
    CHILD_SERIAL_NUMBER       VARCHAR2(320),
    CHILD_ORIG_DATE           TIMESTAMP(6) ,
    CHILD_ORIG_QUANTITY       NUMBER       ,
    CHILD_ORIG_DOC_TYPE       VARCHAR2(120),
    CHILD_ORIG_DOC_NUMBER     VARCHAR2(960),
    CREATED_BY                VARCHAR2(256)    NOT NULL,
    CREATION_DATE             TIMESTAMP(6)     NOT NULL,
    LAST_UPDATED_BY           VARCHAR2(256)    NOT NULL,
    LAST_UPDATE_DATE          TIMESTAMP(6)     NOT NULL,
    LAST_UPDATE_LOGIN         VARCHAR2(128),
    CONSTRAINT pk_cse_genealogy_composition PRIMARY KEY (ROOT_GEN_OBJECT_ID, PARENT_GEN_OBJECT_ID, CHILD_GEN_OBJECT_ID, ROOT_GEN_OBJECT_ID, PARENT_GEN_OBJECT_ID, CHILD_GEN_OBJECT_ID)
);
