CREATE TABLE `AppAnalyticsQueryRequest` (
    `Id` int(11) NOT NULL,
    `IsDeleted` int(11),
    `Name` 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),
    `LastViewedDate` varchar(255),
    `LastReferencedDate` varchar(255),
    `DataType` varchar(255),
    `StartTime` varchar(255),
    `EndTime` varchar(255),
    `RequestState` varchar(255),
    `DownloadUrl` text,
    `DownloadExpirationTime` varchar(255),
    `ErrorMessage` varchar(255),
    `QuerySubmittedTime` varchar(255),
    `PackageIds` varchar(255),
    `OrganizationIds` varchar(255),
    `DownloadSize` text,
    `FileCompression` varchar(255),
    `AvailableSince` varchar(255),
    `FileType` varchar(255),
    PRIMARY KEY (`Id`) ,
    CONSTRAINT `FK_AppAnalyticsQueryRequest_CreatedById` FOREIGN KEY (`CreatedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_AppAnalyticsQueryRequest_LastModifiedById` FOREIGN KEY (`LastModifiedById`) REFERENCES `User` (`Id`)
);
CREATE TABLE `AppDefinition` (
    `Id` int(11) NOT NULL,
    `DurableId` varchar(255),
    `Label` varchar(255),
    `MasterLabel` varchar(255),
    `NamespacePrefix` varchar(255),
    `DeveloperName` varchar(255),
    `LogoUrl` text,
    `Description` varchar(255),
    `UiType` varchar(255),
    `NavType` varchar(255),
    `UtilityBar` varchar(255),
    `HeaderColor` varchar(255),
    `IsOverrideOrgTheme` int(11),
    `IsSmallFormFactorSupported` int(11),
    `IsMediumFormFactorSupported` int(11),
    `IsLargeFormFactorSupported` int(11),
    `IsNavPersonalizationDisabled` int(11),
    `IsNavAutoTempTabsDisabled` int(11),
    PRIMARY KEY (`Id`) 
);
CREATE TABLE `AppMenuItem` (
    `Id` int(11) NOT NULL,
    `IsDeleted` int(11),
    `CreatedDate` varchar(255),
    `CreatedById` int(11), -- foreign key: User.Id,
    `LastModifiedDate` varchar(255),
    `LastModifiedById` int(11), -- foreign key: User.Id,
    `SystemModstamp` varchar(255),
    `SortOrder` int(11),
    `Name` varchar(255),
    `NamespacePrefix` varchar(255),
    `Label` varchar(255),
    `Description` varchar(255),
    `StartUrl` text,
    `MobileStartUrl` text,
    `LogoUrl` text,
    `IconUrl` text,
    `InfoUrl` text,
    `IsUsingAdminAuthorization` int(11),
    `MobilePlatform` varchar(255),
    `MobileMinOsVer` varchar(255),
    `MobileDeviceType` varchar(255),
    `IsRegisteredDeviceOnly` int(11),
    `MobileAppVer` varchar(255),
    `MobileAppInstalledDate` varchar(255),
    `MobileAppInstalledVersion` varchar(255),
    `MobileAppBinaryId` varchar(255),
    `MobileAppInstallUrl` text,
    `CanvasEnabled` int(11),
    `CanvasReferenceId` varchar(255),
    `CanvasUrl` text,
    `CanvasAccessMethod` varchar(255),
    `CanvasSelectedLocations` varchar(255),
    `CanvasOptions` varchar(255),
    `Type` varchar(255),
    `ApplicationId` int(11),
    `UserSortOrder` int(11),
    `IsVisible` int(11),
    `IsAccessible` int(11),
    PRIMARY KEY (`Id`) ,
    CONSTRAINT `FK_AppMenuItem_CreatedById` FOREIGN KEY (`CreatedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_AppMenuItem_LastModifiedById` FOREIGN KEY (`LastModifiedById`) REFERENCES `User` (`Id`)
);
CREATE TABLE `AppTabMember` (
    `Id` int(11) NOT NULL,
    `DurableId` varchar(255),
    `AppDefinitionId` varchar(255), -- foreign key: AppDefinition.Id,
    `TabDefinitionId` varchar(255), -- foreign key: TabDefinition.Id,
    `SortOrder` int(11),
    `WorkspaceDriverField` varchar(255),
    PRIMARY KEY (`Id`) ,
    CONSTRAINT `FK_AppTabMember_AppDefinitionId` FOREIGN KEY (`AppDefinitionId`) REFERENCES `AppDefinition` (`Id`),
    CONSTRAINT `FK_AppTabMember_TabDefinitionId` FOREIGN KEY (`TabDefinitionId`) REFERENCES `TabDefinition` (`Id`)
);
CREATE TABLE `Approval_Hierarchy__ChangeEvent` (
    `Id` int(11) NOT NULL,
    `ReplayId` varchar(255),
    `ChangeEventHeader` varchar(255),
    `Name` varchar(255),
    `CurrencyIsoCode` varchar(255),
    `SetupOwnerId` int(11), -- foreign key: User.Id,
    `CreatedDate` varchar(255),
    `CreatedById` int(11), -- foreign key: User.Id,
    `LastModifiedDate` varchar(255),
    `LastModifiedById` int(11), -- foreign key: User.Id,
    `Active__c` int(11),
    `Approval_Process__c` varchar(255),
    `Level_1_SLA__c` varchar(255),
    `Level_1__c` varchar(255),
    `Level_2_SLA__c` varchar(255),
    `Level_2__c` varchar(255),
    `Level_3_SLA__c` varchar(255),
    `Level_3__c` varchar(255),
    `Object__c` varchar(255),
    PRIMARY KEY (`Id`) ,
    CONSTRAINT `FK_Approval_Hierarchy_ChangeEvent_SetupOwnerId` FOREIGN KEY (`SetupOwnerId`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Approval_Hierarchy_ChangeEvent_CreatedById` FOREIGN KEY (`CreatedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Approval_Hierarchy_ChangeEvent_LastModifiedById` FOREIGN KEY (`LastModifiedById`) REFERENCES `User` (`Id`)
);
CREATE TABLE `Approval_Hierarchy__c` (
    `Id` int(11) NOT NULL,
    `IsDeleted` int(11),
    `Name` varchar(255),
    `CurrencyIsoCode` varchar(255),
    `SetupOwnerId` int(11), -- foreign key: User.Id,
    `CreatedDate` varchar(255),
    `CreatedById` int(11), -- foreign key: User.Id,
    `LastModifiedDate` varchar(255),
    `LastModifiedById` int(11), -- foreign key: User.Id,
    `SystemModstamp` varchar(255),
    `Active__c` int(11),
    `Approval_Process__c` varchar(255),
    `Level_1_SLA__c` varchar(255),
    `Level_1__c` varchar(255),
    `Level_2_SLA__c` varchar(255),
    `Level_2__c` varchar(255),
    `Level_3_SLA__c` varchar(255),
    `Level_3__c` varchar(255),
    `Object__c` varchar(255),
    PRIMARY KEY (`Id`) ,
    CONSTRAINT `FK_Approval_Hierarchy_c_SetupOwnerId` FOREIGN KEY (`SetupOwnerId`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Approval_Hierarchy_c_CreatedById` FOREIGN KEY (`CreatedById`) REFERENCES `User` (`Id`),
    CONSTRAINT `FK_Approval_Hierarchy_c_LastModifiedById` FOREIGN KEY (`LastModifiedById`) REFERENCES `User` (`Id`)
);
