CREATE TABLE `Apttus_Approval__AdhocApprovalGroup__ChangeEvent` (
    `Id` int(11) NOT NULL,
    `ReplayId` varchar(255),
    `ChangeEventHeader` varchar(255),
    `Name` varchar(255),
    `CurrencyIsoCode` varchar(255),
    `CreatedDate` varchar(255),
    `CreatedById` int(11), -- foreign key: User.Id,
    `LastModifiedDate` varchar(255),
    `LastModifiedById` int(11), -- foreign key: User.Id,
    `Apttus_Approval__AdhocApprovalProcessId__c` int(11), -- foreign key: Apttus_Approval__AdhocApprovalProcess__c.Id,
    `Apttus_Approval__DependsOn__c` varchar(255),
    `Apttus_Approval__GroupName__c` varchar(255),
    `Apttus_Approval__GroupSequence__c` varchar(255),
    PRIMARY KEY (`Id`) ,
    CONSTRAINT `FK_Apttus_Approval_AdhocApprovalGroup_ChangeEvent_CreatedById` FOREIGN KEY (`CreatedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Apttus_Approval_AdhocApprovalGroup_ChangeEvent_LastModifiedById` FOREIGN KEY (`LastModifiedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Apttus_Approval_AdhocApprovalGroup_ChangeEvent_Apttus_Approval_AdhocApprovalProcessId_c` FOREIGN KEY (`Apttus_Approval__AdhocApprovalProcessId__c`) REFERENCES `Apttus_Approval__AdhocApprovalProcess__c` (`Id`)
);
CREATE TABLE `Apttus_Approval__AdhocApprovalGroup__c` (
    `Id` int(11) NOT NULL,
    `IsDeleted` int(11),
    `Name` varchar(255),
    `CurrencyIsoCode` varchar(255),
    `CreatedDate` varchar(255),
    `CreatedById` int(11), -- foreign key: User.Id,
    `LastModifiedDate` varchar(255),
    `LastModifiedById` int(11), -- foreign key: User.Id,
    `SystemModstamp` varchar(255),
    `Apttus_Approval__AdhocApprovalProcessId__c` int(11), -- foreign key: Apttus_Approval__AdhocApprovalProcess__c.Id,
    `Apttus_Approval__DependsOn__c` varchar(255),
    `Apttus_Approval__GroupName__c` varchar(255),
    `Apttus_Approval__GroupSequence__c` varchar(255),
    PRIMARY KEY (`Id`) ,
    CONSTRAINT `FK_Apttus_Approval_AdhocApprovalGroup_c_CreatedById` FOREIGN KEY (`CreatedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Apttus_Approval_AdhocApprovalGroup_c_LastModifiedById` FOREIGN KEY (`LastModifiedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Apttus_Approval_AdhocApprovalGroup_c_Apttus_Approval_AdhocApprovalProcessId_c` FOREIGN KEY (`Apttus_Approval__AdhocApprovalProcessId__c`) REFERENCES `Apttus_Approval__AdhocApprovalProcess__c` (`Id`)
);
