Skip to content

Photos 10 (macOS 15 Sequoia beta) schema

Rhet Turnbull edited this page Jun 11, 2024 · 1 revision
/* Z_RT_Asset_boundedByRect(Z_PK,ZLATITUDE_MIN,ZLATITUDE_MAX,ZLONGITUDE_MIN,ZLONGITUDE_MAX) */
;

CREATE INDEX ACHANGE_ZTRANSACTIONID_INDEX ON ACHANGE (ZTRANSACTIONID);

CREATE INDEX ATRANSACTION_ZAUTHORTS_INDEX ON ATRANSACTION (ZAUTHORTS);

CREATE INDEX ATRANSACTION_ZBUNDLEIDTS_INDEX ON ATRANSACTION (ZBUNDLEIDTS);

CREATE INDEX ATRANSACTION_ZCONTEXTNAMETS_INDEX ON ATRANSACTION (ZCONTEXTNAMETS);

CREATE INDEX ATRANSACTION_ZPROCESSIDTS_INDEX ON ATRANSACTION (ZPROCESSIDTS);

CREATE INDEX RADAR_10322662_INDEX ON "Z_31ASSETS" (Z_31ALBUMS, Z_3ASSETS, Z_FOK_3ASSETS);

CREATE INDEX RADAR_22158684_INDEX ON "Z_31ASSETS" (Z_31ALBUMS, Z_FOK_3ASSETS, Z_3ASSETS);

CREATE INDEX ZADDITIONALASSETATTRIBUTES_ZASSETDESCRIPTION_INDEX ON ZADDITIONALASSETATTRIBUTES (ZASSETDESCRIPTION);

CREATE INDEX ZADDITIONALASSETATTRIBUTES_ZASSET_INDEX ON ZADDITIONALASSETATTRIBUTES (ZASSET);

CREATE INDEX ZADDITIONALASSETATTRIBUTES_ZEDITEDIPTCATTRIBUTES_INDEX ON ZADDITIONALASSETATTRIBUTES (ZEDITEDIPTCATTRIBUTES);

CREATE INDEX ZADDITIONALASSETATTRIBUTES_ZMEDIAMETADATA_INDEX ON ZADDITIONALASSETATTRIBUTES (ZMEDIAMETADATA);

CREATE INDEX ZADDITIONALASSETATTRIBUTES_ZSCENEPRINT_INDEX ON ZADDITIONALASSETATTRIBUTES (ZSCENEPRINT);

CREATE INDEX ZADDITIONALASSETATTRIBUTES_ZUNMANAGEDADJUSTMENT_INDEX ON ZADDITIONALASSETATTRIBUTES (ZUNMANAGEDADJUSTMENT);

CREATE INDEX ZASSETANALYSISSTATE_ZASSET_INDEX ON ZASSETANALYSISSTATE (ZASSET);

CREATE INDEX ZASSETCONTRIBUTOR_Z3LIBRARYSCOPEASSETCONTRIBUTORS_INDEX ON ZASSETCONTRIBUTOR (Z3LIBRARYSCOPEASSETCONTRIBUTORS);

CREATE INDEX ZASSETCONTRIBUTOR_ZPARTICIPANT_INDEX ON ZASSETCONTRIBUTOR (ZPARTICIPANT);

CREATE INDEX ZASSETDESCRIPTION_ZASSETATTRIBUTES_INDEX ON ZASSETDESCRIPTION (ZASSETATTRIBUTES);

CREATE INDEX ZASSET_ZADDITIONALATTRIBUTES_INDEX ON ZASSET (ZADDITIONALATTRIBUTES);

CREATE INDEX ZASSET_ZCLOUDFEEDASSETSENTRY_INDEX ON ZASSET (ZCLOUDFEEDASSETSENTRY);

CREATE INDEX ZASSET_ZCOMPUTEDATTRIBUTES_INDEX ON ZASSET (ZCOMPUTEDATTRIBUTES);

CREATE INDEX ZASSET_ZCOMPUTESYNCATTRIBUTES_INDEX ON ZASSET (ZCOMPUTESYNCATTRIBUTES);

CREATE INDEX ZASSET_ZCONVERSATION_INDEX ON ZASSET (ZCONVERSATION);

CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGASSETS_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGASSETS);

CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS);

CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGKEYASSETPRIVATE_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGKEYASSETPRIVATE);

CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGKEYASSETSHARED_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGKEYASSETSHARED);

CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS);

CREATE INDEX ZASSET_ZDAYHIGHLIGHTBEINGCOLLAGEASSETSMIXED_INDEX ON ZASSET (ZDAYHIGHLIGHTBEINGCOLLAGEASSETSMIXED);

CREATE INDEX ZASSET_ZDAYHIGHLIGHTBEINGCOLLAGEASSETSPRIVATE_INDEX ON ZASSET (ZDAYHIGHLIGHTBEINGCOLLAGEASSETSPRIVATE);

CREATE INDEX ZASSET_ZDAYHIGHLIGHTBEINGCOLLAGEASSETSSHARED_INDEX ON ZASSET (ZDAYHIGHLIGHTBEINGCOLLAGEASSETSSHARED);

CREATE INDEX ZASSET_ZDUPLICATEMETADATAMATCHINGALBUM_INDEX ON ZASSET (ZDUPLICATEMETADATAMATCHINGALBUM);

CREATE INDEX ZASSET_ZDUPLICATEPERCEPTUALMATCHINGALBUM_INDEX ON ZASSET (ZDUPLICATEPERCEPTUALMATCHINGALBUM);

CREATE INDEX ZASSET_ZEXTENDEDATTRIBUTES_INDEX ON ZASSET (ZEXTENDEDATTRIBUTES);

CREATE INDEX ZASSET_ZGENERATEDASSETDESCRIPTION_INDEX ON ZASSET (ZGENERATEDASSETDESCRIPTION);

CREATE INDEX ZASSET_ZHIGHLIGHTBEINGASSETS_INDEX ON ZASSET (ZHIGHLIGHTBEINGASSETS);

CREATE INDEX ZASSET_ZHIGHLIGHTBEINGEXTENDEDASSETS_INDEX ON ZASSET (ZHIGHLIGHTBEINGEXTENDEDASSETS);

CREATE INDEX ZASSET_ZHIGHLIGHTBEINGKEYASSETPRIVATE_INDEX ON ZASSET (ZHIGHLIGHTBEINGKEYASSETPRIVATE);

CREATE INDEX ZASSET_ZHIGHLIGHTBEINGKEYASSETSHARED_INDEX ON ZASSET (ZHIGHLIGHTBEINGKEYASSETSHARED);

CREATE INDEX ZASSET_ZHIGHLIGHTBEINGSUMMARYASSETS_INDEX ON ZASSET (ZHIGHLIGHTBEINGSUMMARYASSETS);

CREATE INDEX ZASSET_ZIMPORTSESSION_INDEX ON ZASSET (ZIMPORTSESSION);

CREATE INDEX ZASSET_ZLIBRARYSCOPE_INDEX ON ZASSET (ZLIBRARYSCOPE);

CREATE INDEX ZASSET_ZMASTER_INDEX ON ZASSET (ZMASTER);

CREATE INDEX ZASSET_ZMEDIAANALYSISATTRIBUTES_INDEX ON ZASSET (ZMEDIAANALYSISATTRIBUTES);

CREATE INDEX ZASSET_ZMOMENTSHARE_INDEX ON ZASSET (ZMOMENTSHARE);

CREATE INDEX ZASSET_ZMOMENT_INDEX ON ZASSET (ZMOMENT);

CREATE INDEX ZASSET_ZMONTHHIGHLIGHTBEINGKEYASSETPRIVATE_INDEX ON ZASSET (ZMONTHHIGHLIGHTBEINGKEYASSETPRIVATE);

CREATE INDEX ZASSET_ZMONTHHIGHLIGHTBEINGKEYASSETSHARED_INDEX ON ZASSET (ZMONTHHIGHLIGHTBEINGKEYASSETSHARED);

CREATE INDEX ZASSET_ZPHOTOANALYSISATTRIBUTES_INDEX ON ZASSET (ZPHOTOANALYSISATTRIBUTES);

CREATE INDEX ZASSET_ZTRASHEDBYPARTICIPANT_INDEX ON ZASSET (ZTRASHEDBYPARTICIPANT);

CREATE INDEX ZASSET_ZYEARHIGHLIGHTBEINGKEYASSETPRIVATE_INDEX ON ZASSET (ZYEARHIGHLIGHTBEINGKEYASSETPRIVATE);

CREATE INDEX ZASSET_ZYEARHIGHLIGHTBEINGKEYASSETSHARED_INDEX ON ZASSET (ZYEARHIGHLIGHTBEINGKEYASSETSHARED);

CREATE INDEX ZCHARACTERRECOGNITIONATTRIBUTES_ZMEDIAANALYSISASSETATTRIBUTES_INDEX ON ZCHARACTERRECOGNITIONATTRIBUTES (ZMEDIAANALYSISASSETATTRIBUTES);

CREATE INDEX ZCLOUDFEEDENTRY_Z_ENT_INDEX ON ZCLOUDFEEDENTRY (Z_ENT);

CREATE INDEX ZCLOUDMASTERMEDIAMETADATA_ZADDITIONALASSETATTRIBUTES_INDEX ON ZCLOUDMASTERMEDIAMETADATA (ZADDITIONALASSETATTRIBUTES);

CREATE INDEX ZCLOUDMASTERMEDIAMETADATA_ZCLOUDMASTER_INDEX ON ZCLOUDMASTERMEDIAMETADATA (ZCLOUDMASTER);

CREATE INDEX ZCLOUDMASTER_ZMEDIAMETADATA_INDEX ON ZCLOUDMASTER (ZMEDIAMETADATA);

CREATE INDEX ZCLOUDMASTER_ZMOMENTSHARE_INDEX ON ZCLOUDMASTER (ZMOMENTSHARE);

CREATE INDEX ZCLOUDRESOURCE_ZASSET_INDEX ON ZCLOUDRESOURCE (ZASSET);

CREATE INDEX ZCLOUDRESOURCE_ZCLOUDMASTER_INDEX ON ZCLOUDRESOURCE (ZCLOUDMASTER);

CREATE INDEX ZCLOUDSHAREDALBUMINVITATIONRECORD_ZALBUM_INDEX ON ZCLOUDSHAREDALBUMINVITATIONRECORD (ZALBUM);

CREATE INDEX ZCLOUDSHAREDCOMMENT_ZCLOUDFEEDCOMMENTENTRY_INDEX ON ZCLOUDSHAREDCOMMENT (ZCLOUDFEEDCOMMENTENTRY);

CREATE INDEX ZCLOUDSHAREDCOMMENT_ZCLOUDFEEDLIKECOMMENTENTRY_INDEX ON ZCLOUDSHAREDCOMMENT (ZCLOUDFEEDLIKECOMMENTENTRY);

CREATE INDEX ZCLOUDSHAREDCOMMENT_ZCOMMENTEDASSET_INDEX ON ZCLOUDSHAREDCOMMENT (ZCOMMENTEDASSET);

CREATE INDEX ZCLOUDSHAREDCOMMENT_ZLIKEDASSET_INDEX ON ZCLOUDSHAREDCOMMENT (ZLIKEDASSET);

CREATE INDEX ZCOMPUTEDASSETATTRIBUTES_ZASSET_INDEX ON ZCOMPUTEDASSETATTRIBUTES (ZASSET);

CREATE INDEX ZCOMPUTESYNCATTRIBUTES_ZASSET_INDEX ON ZCOMPUTESYNCATTRIBUTES (ZASSET);

CREATE INDEX ZDETECTEDFACEGROUP_ZASSOCIATEDPERSON_INDEX ON ZDETECTEDFACEGROUP (ZASSOCIATEDPERSON);

CREATE INDEX ZDETECTEDFACEGROUP_ZKEYFACE_INDEX ON ZDETECTEDFACEGROUP (ZKEYFACE);

CREATE INDEX ZDETECTEDFACEPRINT_ZFACE_INDEX ON ZDETECTEDFACEPRINT (ZFACE);

CREATE INDEX ZDETECTEDFACE_ZASSETFORFACE_INDEX ON ZDETECTEDFACE (ZASSETFORFACE);

CREATE INDEX ZDETECTEDFACE_ZASSETFORTEMPORALDETECTEDFACES_INDEX ON ZDETECTEDFACE (ZASSETFORTEMPORALDETECTEDFACES);

CREATE INDEX ZDETECTEDFACE_ZASSETFORTORSO_INDEX ON ZDETECTEDFACE (ZASSETFORTORSO);

CREATE INDEX ZDETECTEDFACE_ZFACECROP_INDEX ON ZDETECTEDFACE (ZFACECROP);

CREATE INDEX ZDETECTEDFACE_ZFACEGROUPBEINGKEYFACE_INDEX ON ZDETECTEDFACE (ZFACEGROUPBEINGKEYFACE);

CREATE INDEX ZDETECTEDFACE_ZFACEGROUP_INDEX ON ZDETECTEDFACE (ZFACEGROUP);

CREATE INDEX ZDETECTEDFACE_ZFACEPRINT_INDEX ON ZDETECTEDFACE (ZFACEPRINT);

CREATE INDEX ZDETECTEDFACE_ZPERSONBEINGKEYFACE_INDEX ON ZDETECTEDFACE (ZPERSONBEINGKEYFACE);

CREATE INDEX ZDETECTEDFACE_ZPERSONFORFACE_INDEX ON ZDETECTEDFACE (ZPERSONFORFACE);

CREATE INDEX ZDETECTEDFACE_ZPERSONFORTEMPORALDETECTEDFACES_INDEX ON ZDETECTEDFACE (ZPERSONFORTEMPORALDETECTEDFACES);

CREATE INDEX ZDETECTEDFACE_ZPERSONFORTORSO_INDEX ON ZDETECTEDFACE (ZPERSONFORTORSO);

CREATE INDEX ZDETECTIONTRAIT_ZDETECTION_INDEX ON ZDETECTIONTRAIT (ZDETECTION);

CREATE INDEX ZEDITEDIPTCATTRIBUTES_ZASSETATTRIBUTES_INDEX ON ZEDITEDIPTCATTRIBUTES (ZASSETATTRIBUTES);

CREATE INDEX ZEXTENDEDATTRIBUTES_ZASSET_INDEX ON ZEXTENDEDATTRIBUTES (ZASSET);

CREATE INDEX ZFACECROP_ZASSET_INDEX ON ZFACECROP (ZASSET);

CREATE INDEX ZFACECROP_ZFACE_INDEX ON ZFACECROP (ZFACE);

CREATE INDEX ZFACECROP_ZPERSON_INDEX ON ZFACECROP (ZPERSON);

CREATE INDEX ZFILESYSTEMBOOKMARK_ZRESOURCE_INDEX ON ZFILESYSTEMBOOKMARK (ZRESOURCE);

CREATE INDEX ZGENERATEDASSETDESCRIPTION_ZASSET_INDEX ON ZGENERATEDASSETDESCRIPTION (ZASSET);

CREATE INDEX ZGENERICALBUM_ZCUSTOMKEYASSET_INDEX ON ZGENERICALBUM (ZCUSTOMKEYASSET);

CREATE INDEX ZGENERICALBUM_ZPARENTFOLDER_INDEX ON ZGENERICALBUM (ZPARENTFOLDER);

CREATE INDEX ZGENERICALBUM_Z_ENT_INDEX ON ZGENERICALBUM (Z_ENT);

CREATE INDEX ZGRAPHEDGEVALUE_ZEDGE_INDEX ON ZGRAPHEDGEVALUE (ZEDGE);

CREATE INDEX ZGRAPHEDGE_ZPRIMARYLABEL_INDEX ON ZGRAPHEDGE (ZPRIMARYLABEL);

CREATE INDEX ZGRAPHEDGE_ZSOURCEASSET_INDEX ON ZGRAPHEDGE (ZSOURCEASSET);

CREATE INDEX ZGRAPHEDGE_ZSOURCEMOMENT_INDEX ON ZGRAPHEDGE (ZSOURCEMOMENT);

CREATE INDEX ZGRAPHEDGE_ZSOURCENODE_INDEX ON ZGRAPHEDGE (ZSOURCENODE);

CREATE INDEX ZGRAPHEDGE_ZSOURCEPERSON_INDEX ON ZGRAPHEDGE (ZSOURCEPERSON);

CREATE INDEX ZGRAPHEDGE_ZTARGETASSET_INDEX ON ZGRAPHEDGE (ZTARGETASSET);

CREATE INDEX ZGRAPHEDGE_ZTARGETMOMENT_INDEX ON ZGRAPHEDGE (ZTARGETMOMENT);

CREATE INDEX ZGRAPHEDGE_ZTARGETNODE_INDEX ON ZGRAPHEDGE (ZTARGETNODE);

CREATE INDEX ZGRAPHEDGE_ZTARGETPERSON_INDEX ON ZGRAPHEDGE (ZTARGETPERSON);

CREATE INDEX ZGRAPHNODEVALUE_ZNODE_INDEX ON ZGRAPHNODEVALUE (ZNODE);

CREATE INDEX ZGRAPHNODE_ZPRIMARYLABEL_INDEX ON ZGRAPHNODE (ZPRIMARYLABEL);

CREATE INDEX ZINTERNALRESOURCE_ZASSET_INDEX ON ZINTERNALRESOURCE (ZASSET);

CREATE INDEX ZINTERNALRESOURCE_ZFILESYSTEMBOOKMARK_INDEX ON ZINTERNALRESOURCE (ZFILESYSTEMBOOKMARK);

CREATE INDEX ZINTERNALRESOURCE_ZFILESYSTEMVOLUME_INDEX ON ZINTERNALRESOURCE (ZFILESYSTEMVOLUME);

CREATE INDEX ZINTERNALRESOURCE_ZTRANSIENTCLOUDMASTER_INDEX ON ZINTERNALRESOURCE (ZTRANSIENTCLOUDMASTER);

CREATE INDEX ZLEGACYFACE_ZASSET_INDEX ON ZLEGACYFACE (ZASSET);

CREATE INDEX ZMEDIAANALYSISASSETATTRIBUTES_ZASSET_INDEX ON ZMEDIAANALYSISASSETATTRIBUTES (ZASSET);

CREATE INDEX ZMEDIAANALYSISASSETATTRIBUTES_ZCHARACTERRECOGNITIONATTRIBUTES_INDEX ON ZMEDIAANALYSISASSETATTRIBUTES (ZCHARACTERRECOGNITIONATTRIBUTES);

CREATE INDEX ZMEDIAANALYSISASSETATTRIBUTES_ZVISUALSEARCHATTRIBUTES_INDEX ON ZMEDIAANALYSISASSETATTRIBUTES (ZVISUALSEARCHATTRIBUTES);

CREATE INDEX ZMEMORY_ZKEYASSET_INDEX ON ZMEMORY (ZKEYASSET);

CREATE INDEX ZMEMORY_ZSOURCEGENERATEDMEMORY_INDEX ON ZMEMORY (ZSOURCEGENERATEDMEMORY);

CREATE INDEX ZMEMORY_ZTARGETUSEREDITEDMEMORY_INDEX ON ZMEMORY (ZTARGETUSEREDITEDMEMORY);

CREATE INDEX ZMOMENT_ZHIGHLIGHT_INDEX ON ZMOMENT (ZHIGHLIGHT);

CREATE INDEX ZPERSONREFERENCE_ZASSETATTRIBUTES_INDEX ON ZPERSONREFERENCE (ZASSETATTRIBUTES);

CREATE INDEX ZPERSONREFERENCE_ZPERSON_INDEX ON ZPERSONREFERENCE (ZPERSON);

CREATE INDEX ZPERSON_ZASSOCIATEDFACEGROUP_INDEX ON ZPERSON (ZASSOCIATEDFACEGROUP);

CREATE INDEX ZPERSON_ZKEYFACE_INDEX ON ZPERSON (ZKEYFACE);

CREATE INDEX ZPERSON_ZMERGETARGETPERSON_INDEX ON ZPERSON (ZMERGETARGETPERSON);

CREATE INDEX ZPERSON_ZSHAREPARTICIPANT_INDEX ON ZPERSON (ZSHAREPARTICIPANT);

CREATE INDEX ZPHOTOANALYSISASSETATTRIBUTES_ZASSET_INDEX ON ZPHOTOANALYSISASSETATTRIBUTES (ZASSET);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZDAYGROUPKEYASSETPRIVATE_INDEX ON ZPHOTOSHIGHLIGHT (ZDAYGROUPKEYASSETPRIVATE);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZDAYGROUPKEYASSETSHARED_INDEX ON ZPHOTOSHIGHLIGHT (ZDAYGROUPKEYASSETSHARED);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZKEYASSETPRIVATE_INDEX ON ZPHOTOSHIGHLIGHT (ZKEYASSETPRIVATE);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZKEYASSETSHARED_INDEX ON ZPHOTOSHIGHLIGHT (ZKEYASSETSHARED);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZMONTHKEYASSETPRIVATE_INDEX ON ZPHOTOSHIGHLIGHT (ZMONTHKEYASSETPRIVATE);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZMONTHKEYASSETSHARED_INDEX ON ZPHOTOSHIGHLIGHT (ZMONTHKEYASSETSHARED);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZPARENTDAYGROUPPHOTOSHIGHLIGHT_INDEX ON ZPHOTOSHIGHLIGHT (ZPARENTDAYGROUPPHOTOSHIGHLIGHT);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZPARENTPHOTOSHIGHLIGHT_INDEX ON ZPHOTOSHIGHLIGHT (ZPARENTPHOTOSHIGHLIGHT);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZYEARKEYASSETPRIVATE_INDEX ON ZPHOTOSHIGHLIGHT (ZYEARKEYASSETPRIVATE);

CREATE INDEX ZPHOTOSHIGHLIGHT_ZYEARKEYASSETSHARED_INDEX ON ZPHOTOSHIGHLIGHT (ZYEARKEYASSETSHARED);

CREATE INDEX ZSCENECLASSIFICATION_ZASSETATTRIBUTESFORTEMPORALSCENECLASSIFICATIONS_INDEX ON ZSCENECLASSIFICATION (ZASSETATTRIBUTESFORTEMPORALSCENECLASSIFICATIONS);

CREATE INDEX ZSCENECLASSIFICATION_ZASSETATTRIBUTES_INDEX ON ZSCENECLASSIFICATION (ZASSETATTRIBUTES);

CREATE INDEX ZSCENEPRINT_ZADDITIONALASSETATTRIBUTES_INDEX ON ZSCENEPRINT (ZADDITIONALASSETATTRIBUTES);

CREATE INDEX ZSHAREPARTICIPANT_ZPERSON_INDEX ON ZSHAREPARTICIPANT (ZPERSON);

CREATE INDEX ZSHAREPARTICIPANT_ZSHARE_INDEX ON ZSHAREPARTICIPANT (ZSHARE);

CREATE INDEX ZSHARE_Z_ENT_INDEX ON ZSHARE (Z_ENT);

CREATE INDEX ZUNMANAGEDADJUSTMENT_ZASSETATTRIBUTES_INDEX ON ZUNMANAGEDADJUSTMENT (ZASSETATTRIBUTES);

CREATE INDEX ZUSERFEEDBACK_ZMEMORY_INDEX ON ZUSERFEEDBACK (ZMEMORY);

CREATE INDEX ZUSERFEEDBACK_ZPERSON_INDEX ON ZUSERFEEDBACK (ZPERSON);

CREATE INDEX ZVISUALSEARCHATTRIBUTES_ZMEDIAANALYSISASSETATTRIBUTES_INDEX ON ZVISUALSEARCHATTRIBUTES (ZMEDIAANALYSISASSETATTRIBUTES);

CREATE INDEX Z_18CLUSTERREJECTEDPERSONS_Z_47CLUSTERREJECTEDPERSONS_INDEX ON "Z_20CLUSTERREJECTEDPERSONS" (
    Z_55CLUSTERREJECTEDPERSONS,
    Z_20CLUSTERREJECTEDFACES
);

CREATE INDEX Z_18REJECTEDPERSONSNEEDINGFACECROPS_Z_47REJECTEDPERSONSNEEDINGFACECROPS_INDEX ON "Z_20REJECTEDPERSONSNEEDINGFACECROPS" (
    Z_55REJECTEDPERSONSNEEDINGFACECROPS,
    Z_20REJECTEDFACESNEEDINGFACECROPS
);

CREATE INDEX Z_18REJECTEDPERSONS_Z_47REJECTEDPERSONS_INDEX ON "Z_20REJECTEDPERSONS" (Z_55REJECTEDPERSONS, Z_20REJECTEDFACES);

CREATE INDEX Z_1KEYWORDS_Z_40KEYWORDS_INDEX ON Z_1KEYWORDS (Z_48KEYWORDS, Z_1ASSETATTRIBUTES);

CREATE INDEX Z_1KEYWORDS_Z_48KEYWORDS_INDEX ON Z_1KEYWORDS (Z_48KEYWORDS, Z_1ASSETATTRIBUTES);

CREATE INDEX Z_20CLUSTERREJECTEDPERSONS_Z_55CLUSTERREJECTEDPERSONS_INDEX ON Z_20CLUSTERREJECTEDPERSONS (
    Z_55CLUSTERREJECTEDPERSONS,
    Z_20CLUSTERREJECTEDFACES
);

CREATE INDEX Z_20REJECTEDPERSONSNEEDINGFACECROPS_Z_55REJECTEDPERSONSNEEDINGFACECROPS_INDEX ON Z_20REJECTEDPERSONSNEEDINGFACECROPS (
    Z_55REJECTEDPERSONSNEEDINGFACECROPS,
    Z_20REJECTEDFACESNEEDINGFACECROPS
);

CREATE INDEX Z_20REJECTEDPERSONS_Z_55REJECTEDPERSONS_INDEX ON Z_20REJECTEDPERSONS (Z_55REJECTEDPERSONS, Z_20REJECTEDFACES);

CREATE INDEX Z_27ALBUMLISTS_Z_2ALBUMLISTS_INDEX ON "Z_30ALBUMLISTS" (Z_2ALBUMLISTS, Z_30ALBUMS);

CREATE INDEX Z_28ASSETS_Z_3ASSETS_INDEX ON "Z_31ASSETS" (Z_3ASSETS, Z_31ALBUMS);

CREATE INDEX Z_30ALBUMLISTS_Z_2ALBUMLISTS_INDEX ON Z_30ALBUMLISTS (Z_2ALBUMLISTS, Z_30ALBUMS);

CREATE INDEX Z_30KEYASSETS_Z_3KEYASSETS_INDEX ON Z_30KEYASSETS (Z_3KEYASSETS, Z_30ALBUMSBEINGKEYASSETS);

CREATE INDEX Z_31ASSETS_Z_3ASSETS_INDEX ON Z_31ASSETS (Z_3ASSETS, Z_31ALBUMS);

CREATE INDEX Z_3MEMORIESBEINGCURATEDASSETS_Z_44MEMORIESBEINGCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGCURATEDASSETS (Z_52MEMORIESBEINGCURATEDASSETS, Z_3CURATEDASSETS);

CREATE INDEX Z_3MEMORIESBEINGCURATEDASSETS_Z_52MEMORIESBEINGCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGCURATEDASSETS (Z_52MEMORIESBEINGCURATEDASSETS, Z_3CURATEDASSETS);

CREATE INDEX Z_3MEMORIESBEINGCUSTOMUSERASSETS_Z_44MEMORIESBEINGCUSTOMUSERASSETS_INDEX ON Z_3MEMORIESBEINGCUSTOMUSERASSETS (
    Z_52MEMORIESBEINGCUSTOMUSERASSETS,
    Z_3CUSTOMUSERASSETS
);

CREATE INDEX Z_3MEMORIESBEINGCUSTOMUSERASSETS_Z_52MEMORIESBEINGCUSTOMUSERASSETS_INDEX ON Z_3MEMORIESBEINGCUSTOMUSERASSETS (
    Z_52MEMORIESBEINGCUSTOMUSERASSETS,
    Z_3CUSTOMUSERASSETS
);

CREATE INDEX Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS_Z_44MEMORIESBEINGEXTENDEDCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS (
    Z_52MEMORIESBEINGEXTENDEDCURATEDASSETS,
    Z_3EXTENDEDCURATEDASSETS
);

CREATE INDEX Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS_Z_52MEMORIESBEINGEXTENDEDCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS (
    Z_52MEMORIESBEINGEXTENDEDCURATEDASSETS,
    Z_3EXTENDEDCURATEDASSETS
);

CREATE INDEX Z_3MEMORIESBEINGMOVIECURATEDASSETS_Z_44MEMORIESBEINGMOVIECURATEDASSETS_INDEX ON Z_3MEMORIESBEINGMOVIECURATEDASSETS (
    Z_52MEMORIESBEINGMOVIECURATEDASSETS,
    Z_3MOVIECURATEDASSETS
);

CREATE INDEX Z_3MEMORIESBEINGMOVIECURATEDASSETS_Z_52MEMORIESBEINGMOVIECURATEDASSETS_INDEX ON Z_3MEMORIESBEINGMOVIECURATEDASSETS (
    Z_52MEMORIESBEINGMOVIECURATEDASSETS,
    Z_3MOVIECURATEDASSETS
);

CREATE INDEX Z_3MEMORIESBEINGREPRESENTATIVEASSETS_Z_44MEMORIESBEINGREPRESENTATIVEASSETS_INDEX ON Z_3MEMORIESBEINGREPRESENTATIVEASSETS (
    Z_52MEMORIESBEINGREPRESENTATIVEASSETS,
    Z_3REPRESENTATIVEASSETS1
);

CREATE INDEX Z_3MEMORIESBEINGREPRESENTATIVEASSETS_Z_52MEMORIESBEINGREPRESENTATIVEASSETS_INDEX ON Z_3MEMORIESBEINGREPRESENTATIVEASSETS (
    Z_52MEMORIESBEINGREPRESENTATIVEASSETS,
    Z_3REPRESENTATIVEASSETS1
);

CREATE INDEX Z_3MEMORIESBEINGUSERCURATEDASSETS_Z_44MEMORIESBEINGUSERCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGUSERCURATEDASSETS (
    Z_52MEMORIESBEINGUSERCURATEDASSETS,
    Z_3USERCURATEDASSETS
);

CREATE INDEX Z_3MEMORIESBEINGUSERCURATEDASSETS_Z_52MEMORIESBEINGUSERCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGUSERCURATEDASSETS (
    Z_52MEMORIESBEINGUSERCURATEDASSETS,
    Z_3USERCURATEDASSETS
);

CREATE INDEX Z_3MEMORIESBEINGUSERREMOVEDASSETS_Z_52MEMORIESBEINGUSERREMOVEDASSETS_INDEX ON Z_3MEMORIESBEINGUSERREMOVEDASSETS (
    Z_52MEMORIESBEINGUSERREMOVEDASSETS,
    Z_3USERREMOVEDASSETS
);

CREATE INDEX Z_3SUGGESTIONSBEINGKEYASSETS_Z_58SUGGESTIONSBEINGKEYASSETS_INDEX ON Z_3SUGGESTIONSBEINGKEYASSETS (Z_66SUGGESTIONSBEINGKEYASSETS, Z_3KEYASSETS1);

CREATE INDEX Z_3SUGGESTIONSBEINGKEYASSETS_Z_66SUGGESTIONSBEINGKEYASSETS_INDEX ON Z_3SUGGESTIONSBEINGKEYASSETS (Z_66SUGGESTIONSBEINGKEYASSETS, Z_3KEYASSETS1);

CREATE INDEX Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS_Z_58SUGGESTIONSBEINGREPRESENTATIVEASSETS_INDEX ON Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS (
    Z_66SUGGESTIONSBEINGREPRESENTATIVEASSETS,
    Z_3REPRESENTATIVEASSETS
);

CREATE INDEX Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS_Z_66SUGGESTIONSBEINGREPRESENTATIVEASSETS_INDEX ON Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS (
    Z_66SUGGESTIONSBEINGREPRESENTATIVEASSETS,
    Z_3REPRESENTATIVEASSETS
);

CREATE INDEX Z_42LABELS_Z_44LABELS_INDEX ON Z_42LABELS (Z_44LABELS, Z_42EDGES);

CREATE INDEX Z_44NODESBEINGADDITIONALLABEL_Z_45NODESBEINGADDITIONALLABEL_INDEX ON Z_44NODESBEINGADDITIONALLABEL (
    Z_45NODESBEINGADDITIONALLABEL,
    Z_44ADDITIONALLABELS
);

CREATE INDEX Z_47INVALIDMERGECANDIDATES_REFLEXIVE_INDEX ON "Z_55INVALIDMERGECANDIDATES" (REFLEXIVE, Z_55INVALIDMERGECANDIDATES);

CREATE INDEX Z_47MERGECANDIDATESWITHCONFIDENCE_REFLEXIVE_INDEX ON "Z_55MERGECANDIDATESWITHCONFIDENCE" (REFLEXIVE, Z_55MERGECANDIDATESWITHCONFIDENCE);

CREATE INDEX Z_47MERGECANDIDATES_REFLEXIVE_INDEX ON "Z_55MERGECANDIDATES" (REFLEXIVE, Z_55MERGECANDIDATES);

CREATE INDEX Z_55INVALIDMERGECANDIDATES_REFLEXIVE_INDEX ON Z_55INVALIDMERGECANDIDATES (REFLEXIVE, Z_55INVALIDMERGECANDIDATES);

CREATE INDEX Z_55MERGECANDIDATESWITHCONFIDENCE_REFLEXIVE_INDEX ON Z_55MERGECANDIDATESWITHCONFIDENCE (REFLEXIVE, Z_55MERGECANDIDATESWITHCONFIDENCE);

CREATE INDEX Z_55MERGECANDIDATES_REFLEXIVE_INDEX ON Z_55MERGECANDIDATES (REFLEXIVE, Z_55MERGECANDIDATES);

CREATE INDEX Z_AdditionalAssetAttributes_byAdjustedFingerPrintIndex ON ZADDITIONALASSETATTRIBUTES (ZADJUSTEDSTABLEHASH COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byAllowedForAnalysisIndex ON ZADDITIONALASSETATTRIBUTES (ZALLOWEDFORANALYSIS COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byCameraCaptureDeviceIndex ON ZADDITIONALASSETATTRIBUTES (ZCAMERACAPTUREDEVICE COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byImportedByBundleIdentifierIndex ON ZADDITIONALASSETATTRIBUTES (ZIMPORTEDBYBUNDLEIDENTIFIER COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byLocationHashIndex ON ZADDITIONALASSETATTRIBUTES (ZLOCATIONHASH COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byMasterFingerPrintIndex ON ZADDITIONALASSETATTRIBUTES (ZORIGINALSTABLEHASH COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byOriginalAssetsUUIDIndex ON ZADDITIONALASSETATTRIBUTES (ZORIGINALASSETSUUID COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byOriginalFileSize ON ZADDITIONALASSETATTRIBUTES (ZORIGINALFILESIZE COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byOriginalHashIndex ON ZADDITIONALASSETATTRIBUTES (ZORIGINALHASH COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byPublicGlobalUUIDIndex ON ZADDITIONALASSETATTRIBUTES (ZPUBLICGLOBALUUID COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byReverseLocationDataIsValidIndex ON ZADDITIONALASSETATTRIBUTES (ZREVERSELOCATIONDATAISVALID COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_byShiftedLocationIsValidIndex ON ZADDITIONALASSETATTRIBUTES (ZSHIFTEDLOCATIONISVALID COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_bySyndicationIdentifierIndex ON ZADDITIONALASSETATTRIBUTES (ZSYNDICATIONIDENTIFIER COLLATE BINARY ASC)
WHERE
    ZSYNDICATIONIDENTIFIER IS NOT NULL;

CREATE INDEX Z_AdditionalAssetAttributes_byUploadAttemptsIndex ON ZADDITIONALASSETATTRIBUTES (ZUPLOADATTEMPTS COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_forFaceAnalysisProgress ON ZADDITIONALASSETATTRIBUTES (
    ZALLOWEDFORANALYSIS COLLATE BINARY ASC,
    ZFACEANALYSISVERSION COLLATE BINARY ASC
);

CREATE INDEX Z_AdditionalAssetAttributes_forRecentlyViewed ON ZADDITIONALASSETATTRIBUTES (ZLASTVIEWEDDATE COLLATE BINARY ASC);

CREATE INDEX Z_AdditionalAssetAttributes_forSceneAnalysisProgress ON ZADDITIONALASSETATTRIBUTES (
    ZALLOWEDFORANALYSIS COLLATE BINARY ASC,
    ZSCENEANALYSISVERSION COLLATE BINARY ASC
);

CREATE INDEX Z_AlbumList_byIdentifierIndex ON ZALBUMLIST (ZIDENTIFIER COLLATE BINARY ASC);

CREATE INDEX Z_AlbumList_byUuidIndex ON ZALBUMLIST (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_Album_bySearchIndexRebuildState ON ZGENERICALBUM (ZSEARCHINDEXREBUILDSTATE COLLATE BINARY ASC)
WHERE
    ZSEARCHINDEXREBUILDSTATE = 1;

CREATE INDEX Z_AssetAnalysisState_bySortTokenIndex ON ZASSETANALYSISSTATE (ZSORTTOKEN COLLATE BINARY ASC);

CREATE INDEX Z_AssetAnalysisState_byWorkerTypeIndex ON ZASSETANALYSISSTATE (ZWORKERTYPE COLLATE BINARY ASC);

CREATE INDEX Z_AssetAnalysisState_compoundIndex ON ZASSETANALYSISSTATE (
    ZWORKERTYPE COLLATE BINARY ASC,
    ZSORTTOKEN COLLATE BINARY ASC
);

CREATE INDEX Z_AssetAnalysisState_compoundIndex1 ON ZASSETANALYSISSTATE (
    ZANALYSISSTATE COLLATE BINARY ASC,
    ZWORKERTYPE COLLATE BINARY ASC,
    ZASSET COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_byActiveLibraryScopeParticipationAndShareState ON ZASSET (
    ZACTIVELIBRARYSCOPEPARTICIPATIONSTATE COLLATE BINARY ASC,
    ZLIBRARYSCOPESHARESTATE COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY DESC
);

CREATE INDEX Z_Asset_byAddedDateIndex ON ZASSET (ZADDEDDATE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byAvalanchePickTypeIndex ON ZASSET (ZAVALANCHEPICKTYPE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byAvalancheUUIDIndex ON ZASSET (ZAVALANCHEUUID COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byCloudAssetGUIDIndex ON ZASSET (ZCLOUDASSETGUID COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byCloudPlaceholderKindIndex ON ZASSET (ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byCompleteIndex ON ZASSET (ZCOMPLETE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byCustomRenderedValueIndex ON ZASSET (ZHDRTYPE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byDateCreatedIndex ON ZASSET (ZDATECREATED COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byKindIndex ON ZASSET (ZKIND COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byLastSharedDateIndex ON ZASSET (ZLASTSHAREDDATE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byMediaGroupUUIDIndex ON ZASSET (ZMEDIAGROUPUUID COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byPlaybackStyleIndex ON ZASSET (ZPLAYBACKSTYLE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byPlaybackVariationIndex ON ZASSET (ZPLAYBACKVARIATION COLLATE BINARY ASC);

CREATE INDEX Z_Asset_bySavedAssetTypeIndex ON ZASSET (ZSAVEDASSETTYPE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_bySearchIndexRebuildState ON ZASSET (ZSEARCHINDEXREBUILDSTATE COLLATE BINARY ASC)
WHERE
    ZSEARCHINDEXREBUILDSTATE = 1;

CREATE INDEX Z_Asset_bySortTokenIndex ON ZASSET (ZSORTTOKEN COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byThumbnailIndexIndex ON ZASSET (ZTHUMBNAILINDEX COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byUniformTypeIdentifierIndex ON ZASSET (ZUNIFORMTYPEIDENTIFIER COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byUuidIndex ON ZASSET (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_Asset_byVisibilityStateIndex ON ZASSET (ZVISIBILITYSTATE COLLATE BINARY ASC);

CREATE INDEX Z_Asset_compoundIndex1 ON ZASSET (
    ZCLOUDASSETGUID COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex14 ON ZASSET (
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC,
    ZCLOUDSERVERPUBLISHDATE COLLATE BINARY ASC,
    ZCLOUDBATCHPUBLISHDATE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex15 ON ZASSET (
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZLOCATIONDATA COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex16 ON ZASSET (
    ZIMPORTSESSION COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex17 ON ZASSET (
    ZCLOUDHASUNSEENCOMMENTS COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex19 ON ZASSET (
    ZDEFERREDPROCESSINGNEEDED COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex2 ON ZASSET (
    ZDIRECTORY COLLATE BINARY ASC,
    ZFILENAME COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex3 ON ZASSET (
    ZCLOUDLOCALSTATE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex4 ON ZASSET (
    ZHIDDEN COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex5 ON ZASSET (
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZTRASHEDDATE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex6 ON ZASSET (
    ZADDEDDATE COLLATE BINARY ASC,
    ZSORTTOKEN COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex8 ON ZASSET (
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZCLOUDLOCALSTATE COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_compoundIndex9 ON ZASSET (
    ZKIND COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZCLOUDLOCALSTATE COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forAllPhotos ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forAllPhotosByLibraryScopeParticipationState ON ZASSET (
    ZACTIVELIBRARYSCOPEPARTICIPATIONSTATE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forAllPhotosDayGroups ON ZASSET (
    ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZACTIVELIBRARYSCOPEPARTICIPATIONSTATE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forAllPhotosDays ON ZASSET (
    ZHIGHLIGHTBEINGEXTENDEDASSETS COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC
)
WHERE
    ZHIGHLIGHTBEINGEXTENDEDASSETS IS NOT NULL;

CREATE INDEX Z_Asset_forAllPhotosFilteredByHasAdjustments ON ZASSET (
    ZADJUSTMENTSSTATE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZFAVORITE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forAllPhotosFilteredBySavedAssetType ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZFAVORITE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC,
    ZISDETECTEDSCREENSHOT COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forAllPhotosHavingCaptureSession ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZCAPTURESESSIONIDENTIFIER COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC
)
WHERE
    ZCAPTURESESSIONIDENTIFIER IS NOT NULL;

CREATE INDEX Z_Asset_forAllPhotosHavingImportSession ON ZASSET (
    ZIMPORTSESSION COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    ZIMPORTSESSION IS NOT NULL;

CREATE INDEX Z_Asset_forAllPhotosPartOfDuplicatedSet ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC
)
WHERE
    ZDUPLICATEASSETVISIBILITYSTATE <> 0;

CREATE INDEX Z_Asset_forAllPhotosPrivateOnly ON ZASSET (
    ZACTIVELIBRARYSCOPEPARTICIPATIONSTATE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC
)
WHERE
    ZACTIVELIBRARYSCOPEPARTICIPATIONSTATE = 0;

CREATE INDEX Z_Asset_forCPLThumbnailPrefetch ON ZASSET (
    ZTHUMBNAILINDEX COLLATE BINARY DESC,
    ZCLOUDLOCALSTATE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY DESC,
    ZADJUSTMENTSSTATE COLLATE BINARY ASC
)
WHERE
    (
        ZTHUMBNAILINDEX = -1
        AND ZCLOUDLOCALSTATE = 1
    );

CREATE INDEX Z_Asset_forFavoritesAlbum ON ZASSET (
    ZFAVORITE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC
)
WHERE
    ZFAVORITE = 1;

CREATE INDEX Z_Asset_forKindSubtypeAlbums ON ZASSET (
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    ZKINDSUBTYPE <> 0;

CREATE INDEX Z_Asset_forMagicCarpetAlbum ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZISMAGICCARPET COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    ZISMAGICCARPET = 1;

CREATE INDEX Z_Asset_forPHThumbnailAsset ON ZASSET (
    ZTHUMBNAILINDEX COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC,
    ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forPlacesAlbum ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC,
    ZLATITUDE COLLATE BINARY ASC,
    ZLONGITUDE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forPortraitAlbum ON ZASSET (
    ZDEPTHTYPE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    ZDEPTHTYPE <> 0;

CREATE INDEX Z_Asset_forRAWAlbum ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZPACKEDBADGEATTRIBUTES COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    ZPACKEDBADGEATTRIBUTES > 1;

CREATE INDEX Z_Asset_forRecentlyEdited ON ZASSET (ZADJUSTMENTTIMESTAMP COLLATE BINARY ASC);

CREATE INDEX Z_Asset_forSelfiesAlbum ON ZASSET (
    ZDERIVEDCAMERACAPTUREDEVICE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    ZDERIVEDCAMERACAPTUREDEVICE = 1;

CREATE INDEX Z_Asset_forSharingSuggestionsAlbum ON ZASSET (
    ZLIBRARYSCOPESHARESTATE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    (
        ZLIBRARYSCOPESHARESTATE = 2
        OR ZLIBRARYSCOPESHARESTATE = 16
        OR ZLIBRARYSCOPESHARESTATE = 65538
        OR ZLIBRARYSCOPESHARESTATE = 65552
    );

CREATE INDEX Z_Asset_forSpatialAlbum ON ZASSET (
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC
)
WHERE
    ZSPATIALTYPE <> 0;

CREATE INDEX Z_Asset_forUnableToUploadAlbum ON ZASSET (
    ZCLOUDLOCALSTATE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    (
        ZCLOUDLOCALSTATE = 2
        OR ZCLOUDLOCALSTATE = 4
    );

CREATE INDEX Z_Asset_forUserLibraryAlbumAndPhotoPicker ON ZASSET (
    ZADDEDDATE COLLATE BINARY ASC,
    ZSORTTOKEN COLLATE BINARY ASC,
    ZACTIVELIBRARYSCOPEPARTICIPATIONSTATE COLLATE BINARY ASC,
    ZISRECENTLYSAVED COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZKINDSUBTYPE COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC,
    ZFAVORITE COLLATE BINARY ASC,
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZDUPLICATEASSETVISIBILITYSTATE COLLATE BINARY ASC,
    ZSTICKERCONFIDENCESCORE COLLATE BINARY ASC
);

CREATE INDEX Z_Asset_forVideosAlbum ON ZASSET (
    ZPLAYBACKSTYLE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZADDEDDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC,
    ZSAVEDASSETTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC,
    ZHIDDEN COLLATE BINARY ASC,
    ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZCOMPLETE COLLATE BINARY ASC
)
WHERE
    ZPLAYBACKSTYLE = 4;

CREATE INDEX Z_BackgroundJobWorkItem_byIdentifierIndex ON ZBACKGROUNDJOBWORKITEM (ZIDENTIFIER COLLATE BINARY ASC);

CREATE INDEX Z_CloudFeedEntry_byEntryDateIndex ON ZCLOUDFEEDENTRY (ZENTRYDATE COLLATE BINARY ASC);

CREATE INDEX Z_CloudFeedEntry_compoundIndex ON ZCLOUDFEEDENTRY (
    ZENTRYDATE COLLATE BINARY ASC,
    ZENTRYPRIORITYNUMBER COLLATE BINARY ASC,
    ZENTRYTYPENUMBER COLLATE BINARY ASC
);

CREATE INDEX Z_CloudFeedEntry_compoundIndex1 ON ZCLOUDFEEDENTRY (
    Z_ENT COLLATE BINARY ASC,
    ZENTRYDATE COLLATE BINARY ASC
);

CREATE INDEX Z_CloudFeedEntry_forMineVsTheirsIndex ON ZCLOUDFEEDENTRY (
    ZENTRYTYPENUMBER COLLATE BINARY ASC,
    ZENTRYISMINE COLLATE BINARY ASC,
    ZENTRYPRIORITYNUMBER COLLATE BINARY DESC,
    ZENTRYDATE COLLATE BINARY DESC
);

CREATE INDEX Z_CloudMasterMediaMetadata_byDataNULLIndex ON ZCLOUDMASTERMEDIAMETADATA (
    ZDATA COLLATE BINARY ASC,
    ZCLOUDMASTER COLLATE BINARY ASC
)
WHERE
    ZDATA IS NULL;

CREATE INDEX Z_CloudMaster_byCloudLocalStateIndex ON ZCLOUDMASTER (ZCLOUDLOCALSTATE COLLATE BINARY ASC);

CREATE INDEX Z_CloudMaster_byCloudMasterGUIDIndex ON ZCLOUDMASTER (ZCLOUDMASTERGUID COLLATE BINARY ASC);

CREATE INDEX Z_CloudResource_byAssetUuidIndex ON ZCLOUDRESOURCE (ZASSETUUID COLLATE BINARY ASC);

CREATE INDEX Z_CloudResource_byDateCreatedIndex ON ZCLOUDRESOURCE (ZDATECREATED COLLATE BINARY ASC);

CREATE INDEX Z_CloudResource_byIsAvailableIndex ON ZCLOUDRESOURCE (ZISAVAILABLE COLLATE BINARY ASC);

CREATE INDEX Z_CloudResource_byIsLocallyAvailableIndex ON ZCLOUDRESOURCE (ZISLOCALLYAVAILABLE COLLATE BINARY ASC);

CREATE INDEX Z_CloudResource_byTypeIndex ON ZCLOUDRESOURCE (ZTYPE COLLATE BINARY ASC);

CREATE INDEX Z_CloudResource_compoundIndex ON ZCLOUDRESOURCE (
    ZTYPE COLLATE BINARY ASC,
    ZISLOCALLYAVAILABLE COLLATE BINARY ASC,
    ZISAVAILABLE COLLATE BINARY ASC,
    ZDATECREATED COLLATE BINARY ASC,
    ZLASTONDEMANDDOWNLOADDATE COLLATE BINARY ASC,
    ZLASTPREFETCHDATE COLLATE BINARY ASC
);

CREATE INDEX Z_CloudSharedComment_byCloudGUIDIndex ON ZCLOUDSHAREDCOMMENT (ZCLOUDGUID COLLATE BINARY ASC);

CREATE INDEX Z_CloudSharedComment_byCommentDateIndex ON ZCLOUDSHAREDCOMMENT (ZCOMMENTDATE COLLATE BINARY ASC);

CREATE INDEX Z_DeferredRebuildFace_byAssetCloudGUIDIndex ON ZDEFERREDREBUILDFACE (ZASSETCLOUDGUID COLLATE BINARY ASC);

CREATE INDEX Z_DetectedFaceGroup_byPersonBuilderStateIndex ON ZDETECTEDFACEGROUP (ZPERSONBUILDERSTATE COLLATE BINARY ASC);

CREATE INDEX Z_DetectedFace_byCloudLocalStateIndex ON ZDETECTEDFACE (ZCLOUDLOCALSTATE COLLATE BINARY ASC);

CREATE INDEX Z_DetectedFace_byClusterSequenceNumberIndex ON ZDETECTEDFACE (ZCLUSTERSEQUENCENUMBER COLLATE BINARY ASC);

CREATE INDEX Z_DetectedFace_byPersonAssetIndex ON ZDETECTEDFACE (
    ZPERSONFORFACE COLLATE BINARY ASC,
    ZASSETFORFACE COLLATE BINARY ASC
);

CREATE INDEX Z_DetectedFace_byUuidIndex ON ZDETECTEDFACE (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_DetectedFace_byVuObservationIDIndex ON ZDETECTEDFACE (ZVUOBSERVATIONID COLLATE BINARY ASC);

CREATE INDEX Z_DetectedFace_forCountOfFaceCropsToBeGenerated ON ZDETECTEDFACE (
    ZFACECROP COLLATE BINARY ASC,
    ZDURATION COLLATE BINARY ASC,
    ZMANUAL COLLATE BINARY ASC,
    ZCENTERX COLLATE BINARY ASC,
    ZBODYCENTERX COLLATE BINARY ASC,
    ZCONFIRMEDFACECROPGENERATIONSTATE COLLATE BINARY ASC
)
WHERE
    (
        ZFACECROP IS NULL
        AND ZDURATION = 0
        AND ZMANUAL = 0
        AND (
            ZCENTERX <> 0
            OR ZBODYCENTERX = 0
        )
    );

CREATE INDEX Z_FaceCrop_byCloudLocalStateIndex ON ZFACECROP (ZCLOUDLOCALSTATE COLLATE BINARY ASC);

CREATE INDEX Z_FaceCrop_byStateIndex ON ZFACECROP (ZSTATE COLLATE BINARY ASC);

CREATE INDEX Z_FaceCrop_byUuidIndex ON ZFACECROP (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_FetchingAlbum_bySearchIndexRebuildState ON ZGENERICALBUM (ZSEARCHINDEXREBUILDSTATE1 COLLATE BINARY ASC)
WHERE
    ZSEARCHINDEXREBUILDSTATE1 = 1;

CREATE INDEX Z_FileSystemVolume_byUuidIndex ON ZFILESYSTEMVOLUME (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_FileSystemVolume_byVolumeUuidStringIndex ON ZFILESYSTEMVOLUME (ZVOLUMEUUIDSTRING COLLATE BINARY ASC);

CREATE INDEX Z_GenericAlbum_byCloudGUIDIndex ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);

CREATE INDEX Z_GenericAlbum_byCloudLocalStateIndex ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);

CREATE INDEX Z_GenericAlbum_byImportSessionIDIndex ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);

CREATE INDEX Z_GenericAlbum_byKindIndex ON ZGENERICALBUM (
    ZKIND COLLATE BINARY ASC,
    Z_ENT COLLATE BINARY ASC
);

CREATE INDEX Z_GenericAlbum_bySyncEventOrderKeyIndex ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);

CREATE INDEX Z_GenericAlbum_byUuidIndex ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_GlobalKeyValue_byKeyIndex ON ZGLOBALKEYVALUE (ZKEY COLLATE BINARY ASC);

CREATE INDEX Z_GraphNodeValue_byValueNameIndex ON ZGRAPHNODEVALUE (ZVALUENAME COLLATE BINARY ASC);

CREATE INDEX Z_GraphNode_byPrimaryLabelAndUuidIndex ON ZGRAPHNODE (
    ZPRIMARYLABEL COLLATE BINARY ASC,
    ZUUID COLLATE BINARY ASC
);

CREATE INDEX Z_InternalResource_byCloudMasterDateCreatedIndex ON ZINTERNALRESOURCE (ZCLOUDMASTERDATECREATED COLLATE BINARY ASC);

CREATE INDEX Z_InternalResource_byFileIDIndex ON ZINTERNALRESOURCE (ZFILEID COLLATE BINARY ASC);

CREATE INDEX Z_InternalResource_byLocalAvailabilityIndex ON ZINTERNALRESOURCE (
    ZLOCALAVAILABILITY COLLATE BINARY ASC,
    ZLOCALAVAILABILITYTARGET COLLATE BINARY ASC,
    ZRECIPEID COLLATE BINARY ASC
);

CREATE INDEX Z_InternalResource_compoundIndex ON ZINTERNALRESOURCE (
    ZTRASHEDDATE COLLATE BINARY ASC,
    ZTRASHEDSTATE COLLATE BINARY ASC
);

CREATE INDEX Z_InternalResource_compoundIndex1 ON ZINTERNALRESOURCE (
    ZDATASTORECLASSID COLLATE BINARY ASC,
    ZDATASTORESUBTYPE COLLATE BINARY ASC,
    ZLOCALAVAILABILITY COLLATE BINARY ASC,
    ZREMOTEAVAILABILITY COLLATE BINARY ASC,
    ZASSET COLLATE BINARY ASC
);

CREATE INDEX Z_InternalResource_forCloudPrefetch ON ZINTERNALRESOURCE (
    ZDATASTORECLASSID COLLATE BINARY ASC,
    ZREMOTEAVAILABILITY COLLATE BINARY ASC,
    ZLOCALAVAILABILITY COLLATE BINARY ASC,
    ZDATASTORESUBTYPE COLLATE BINARY ASC,
    ZVERSION COLLATE BINARY ASC,
    ZCLOUDMASTERDATECREATED COLLATE BINARY DESC
)
WHERE
    (
        ZDATASTORECLASSID = 0
        AND ZREMOTEAVAILABILITY = 1
        AND ZLOCALAVAILABILITY = -1
    );

CREATE INDEX Z_InternalResource_forCloudPrefetchCompute ON ZINTERNALRESOURCE (
    ZDATASTORECLASSID COLLATE BINARY ASC,
    ZREMOTEAVAILABILITY COLLATE BINARY ASC,
    ZLOCALAVAILABILITY COLLATE BINARY ASC,
    ZDATASTORESUBTYPE COLLATE BINARY ASC,
    ZVERSION COLLATE BINARY ASC,
    ZCLOUDMASTERDATECREATED COLLATE BINARY DESC
)
WHERE
    (
        ZDATASTORECLASSID = 0
        AND ZRESOURCETYPE = 14
        AND ZREMOTEAVAILABILITY = 1
        AND ZLOCALAVAILABILITY = -1
    );

CREATE INDEX Z_InternalResource_forCloudPrefetchThumbs ON ZINTERNALRESOURCE (
    ZASSET COLLATE BINARY ASC,
    ZDATASTORECLASSID COLLATE BINARY ASC,
    ZDATASTORESUBTYPE COLLATE BINARY ASC,
    ZVERSION COLLATE BINARY ASC
)
WHERE
    (
        ZDATASTORECLASSID = 0
        AND ZDATASTORESUBTYPE = 5
    );

CREATE INDEX Z_Keyword_byTitleIndex ON ZKEYWORD (ZTITLE COLLATE BINARY ASC);

CREATE INDEX Z_Keyword_byUuidIndex ON ZKEYWORD (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_LegacyFace_byAlbumUUIDIndex ON ZLEGACYFACE (ZALBUMUUID COLLATE BINARY ASC);

CREATE INDEX Z_LegacyFace_byIdentifierIndex ON ZLEGACYFACE (ZIDENTIFIER COLLATE BINARY ASC);

CREATE INDEX Z_Memory_byCloudLocalStateIndex ON ZMEMORY (ZCLOUDLOCALSTATE COLLATE BINARY ASC);

CREATE INDEX Z_Memory_byFeaturedState ON ZMEMORY (ZFEATUREDSTATE COLLATE BINARY ASC);

CREATE INDEX Z_Memory_byLastMoviePlayedDateIndex ON ZMEMORY (ZLASTMOVIEPLAYEDDATE COLLATE BINARY ASC);

CREATE INDEX Z_Memory_byLastViewedDateIndex ON ZMEMORY (ZLASTVIEWEDDATE COLLATE BINARY ASC);

CREATE INDEX Z_Memory_byNonNilBlacklistedFeature ON ZMEMORY (ZBLACKLISTEDFEATURE COLLATE BINARY ASC)
WHERE
    ZBLACKLISTEDFEATURE IS NOT NULL;

CREATE INDEX Z_Memory_byNonNilGraphMemoryIdentifier ON ZMEMORY (ZGRAPHMEMORYIDENTIFIER COLLATE BINARY ASC)
WHERE
    ZGRAPHMEMORYIDENTIFIER IS NOT NULL;

CREATE INDEX Z_Memory_byPendingIndex ON ZMEMORY (ZPENDINGSTATE COLLATE BINARY ASC);

CREATE INDEX Z_Memory_bySearchIndexRebuildState ON ZMEMORY (ZSEARCHINDEXREBUILDSTATE COLLATE BINARY ASC)
WHERE
    ZSEARCHINDEXREBUILDSTATE = 1;

CREATE INDEX Z_Memory_byUuidIndex ON ZMEMORY (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_Memory_forFeatured ON ZMEMORY (
    ZCREATIONDATE COLLATE BINARY DESC,
    ZSCORE COLLATE BINARY DESC,
    Z_PK COLLATE BINARY ASC,
    ZREJECTED COLLATE BINARY DESC,
    ZFEATUREDSTATE COLLATE BINARY ASC,
    ZPENDINGSTATE COLLATE BINARY ASC
);

CREATE INDEX Z_Memory_forUpload ON ZMEMORY (
    ZPENDINGSTATE COLLATE BINARY ASC,
    ZCLOUDLOCALSTATE COLLATE BINARY ASC,
    ZSYNDICATEDCONTENTSTATE COLLATE BINARY ASC,
    ZCREATIONDATE COLLATE BINARY DESC
);

CREATE INDEX Z_MigrationHistory_byIndexIndex ON ZMIGRATIONHISTORY (ZINDEX COLLATE BINARY ASC);

CREATE INDEX Z_MigrationHistory_byMigrationDateIndex ON ZMIGRATIONHISTORY (ZMIGRATIONDATE COLLATE BINARY ASC);

CREATE INDEX Z_Moment_byEndDateIndex ON ZMOMENT (ZENDDATE COLLATE BINARY ASC);

CREATE INDEX Z_Moment_byRepresentativeDateIndex ON ZMOMENT (ZREPRESENTATIVEDATE COLLATE BINARY ASC);

CREATE INDEX Z_Moment_byStartDateIndex ON ZMOMENT (ZSTARTDATE COLLATE BINARY ASC);

CREATE INDEX Z_Moment_byTrashedStateIndex ON ZMOMENT (ZTRASHEDSTATE COLLATE BINARY ASC);

CREATE INDEX Z_Moment_byUuidIndex ON ZMOMENT (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_Moment_compoundIndex ON ZMOMENT (
    ZSTARTDATE COLLATE BINARY ASC,
    ZENDDATE COLLATE BINARY ASC
);

CREATE INDEX Z_Person_byCloudLocalStateAndVerifiedType ON ZPERSON (
    ZCLOUDLOCALSTATE COLLATE BINARY ASC,
    ZVERIFIEDTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Person_byFaceCountIndex ON ZPERSON (ZFACECOUNT COLLATE BINARY ASC);

CREATE INDEX Z_Person_byManualOrderIndex ON ZPERSON (ZMANUALORDER COLLATE BINARY ASC);

CREATE INDEX Z_Person_byMdIDIndex ON ZPERSON (ZMDID COLLATE BINARY ASC)
WHERE
    ZMDID IS NOT NULL;

CREATE INDEX Z_Person_byPersonUUIDIndex ON ZPERSON (ZPERSONUUID COLLATE BINARY ASC);

CREATE INDEX Z_Person_bySuggestedForClientType ON ZPERSON (ZSUGGESTEDFORCLIENTTYPE COLLATE BINARY ASC);

CREATE INDEX Z_Person_byTypeIndex ON ZPERSON (ZTYPE COLLATE BINARY ASC);

CREATE INDEX Z_Person_byVerifiedTypeIndex ON ZPERSON (ZVERIFIEDTYPE COLLATE BINARY ASC);

CREATE INDEX Z_Person_compoundIndex ON ZPERSON (
    ZVERIFIEDTYPE COLLATE BINARY ASC,
    ZFACECOUNT COLLATE BINARY ASC,
    ZTYPE COLLATE BINARY ASC
);

CREATE INDEX Z_Person_forPersonUriFetch ON ZPERSON (
    ZPERSONURI COLLATE BINARY ASC,
    ZFACECOUNT COLLATE BINARY ASC
);

CREATE INDEX Z_PhotosHighlight_byDateRangeAndKind ON ZPHOTOSHIGHLIGHT (
    ZKIND COLLATE BINARY ASC,
    ZSTARTDATE COLLATE BINARY DESC,
    ZENDDATE COLLATE BINARY DESC,
    Z_PK COLLATE BINARY ASC,
    ZTYPE COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZVISIBILITYSTATEMIXED COLLATE BINARY ASC,
    ZVISIBILITYSTATESHARED COLLATE BINARY ASC,
    ZEXTENDEDCOUNT COLLATE BINARY ASC,
    ZEXTENDEDCOUNTSHARED COLLATE BINARY ASC
);

CREATE INDEX Z_PhotosHighlight_byKindIndex ON ZPHOTOSHIGHLIGHT (ZKIND COLLATE BINARY ASC);

CREATE INDEX Z_PhotosHighlight_byParentAndKind ON ZPHOTOSHIGHLIGHT (
    ZPARENTPHOTOSHIGHLIGHT COLLATE BINARY ASC,
    ZKIND COLLATE BINARY ASC,
    ZSTARTDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC
);

CREATE INDEX Z_PhotosHighlight_bySearchIndexRebuildState ON ZPHOTOSHIGHLIGHT (ZSEARCHINDEXREBUILDSTATE COLLATE BINARY ASC)
WHERE
    ZSEARCHINDEXREBUILDSTATE = 1;

CREATE INDEX Z_PhotosHighlight_byUuidIndex ON ZPHOTOSHIGHLIGHT (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_PhotosHighlight_forHighlightsVisibilityState ON ZPHOTOSHIGHLIGHT (
    ZKIND COLLATE BINARY ASC,
    ZVISIBILITYSTATE COLLATE BINARY ASC,
    ZPROMOTIONSCORE COLLATE BINARY ASC,
    ZSHARINGCOMPOSITION COLLATE BINARY ASC,
    ZTYPE COLLATE BINARY ASC,
    ZSTARTDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC
);

CREATE INDEX Z_PhotosHighlight_forHighlightsVisibilityStateMixed ON ZPHOTOSHIGHLIGHT (
    ZKIND COLLATE BINARY ASC,
    ZVISIBILITYSTATEMIXED COLLATE BINARY ASC,
    ZPROMOTIONSCORE COLLATE BINARY ASC,
    ZTYPE COLLATE BINARY ASC,
    ZSTARTDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC
);

CREATE INDEX Z_PhotosHighlight_forHighlightsVisibilityStateShared ON ZPHOTOSHIGHLIGHT (
    ZKIND COLLATE BINARY ASC,
    ZVISIBILITYSTATESHARED COLLATE BINARY ASC,
    ZPROMOTIONSCORE COLLATE BINARY ASC,
    ZSHARINGCOMPOSITION COLLATE BINARY ASC,
    ZTYPE COLLATE BINARY ASC,
    ZSTARTDATE COLLATE BINARY ASC,
    Z_PK COLLATE BINARY ASC
);

CREATE INDEX Z_Question_byUuidIndex ON ZQUESTION (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_SceneClassification_bySceneIdentifierAndConfidence ON ZSCENECLASSIFICATION (
    ZSCENEIDENTIFIER COLLATE BINARY ASC,
    ZCONFIDENCE COLLATE BINARY ASC
);

CREATE INDEX Z_SceneClassification_forSceneClassificationsByAsset ON ZSCENECLASSIFICATION (
    ZASSETATTRIBUTES COLLATE BINARY ASC,
    ZSCENEIDENTIFIER COLLATE BINARY ASC,
    ZCONFIDENCE COLLATE BINARY ASC,
    ZPACKEDBOUNDINGBOXRECT COLLATE BINARY ASC
);

CREATE INDEX Z_ShareParticipant_byUuidIndex ON ZSHAREPARTICIPANT (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_Share_byCreationDate ON ZSHARE (
    Z_ENT COLLATE BINARY ASC,
    ZCREATIONDATE COLLATE BINARY ASC
);

CREATE INDEX Z_Share_byShareURLIndex ON ZSHARE (ZSHAREURL COLLATE BINARY ASC);

CREATE INDEX Z_Share_byUuidIndex ON ZSHARE (ZUUID COLLATE BINARY ASC);

CREATE INDEX Z_Suggestion_byCreationDate ON ZSUGGESTION (ZCREATIONDATE COLLATE BINARY DESC);

CREATE INDEX Z_Suggestion_byFeaturedState ON ZSUGGESTION (ZFEATUREDSTATE COLLATE BINARY ASC);

CREATE INDEX Z_Suggestion_byStateIndex ON ZSUGGESTION (ZSTATE COLLATE BINARY ASC);

CREATE INDEX Z_Suggestion_notDeniedBySubtype ON ZSUGGESTION (ZSUBTYPE COLLATE BINARY ASC)
WHERE
    ZSTATE <> 4;

CREATE INDEX Z_Suggestion_notDeniedByType ON ZSUGGESTION (ZTYPE COLLATE BINARY ASC)
WHERE
    ZSTATE <> 4;

CREATE INDEX Z_TRANSACTION_TransactionAuthorIndex ON ATRANSACTION (ZAUTHOR COLLATE BINARY ASC);

CREATE INDEX Z_TRANSACTION_TransactionTimestampIndex ON ATRANSACTION (ZTIMESTAMP COLLATE BINARY ASC);

CREATE INDEX Z_UserFeedback_byFeatureIndex ON ZUSERFEEDBACK (ZFEATURE COLLATE BINARY ASC);

CREATE INDEX Z_UserFeedback_byTypeIndex ON ZUSERFEEDBACK (ZTYPE COLLATE BINARY ASC);

CREATE INDEX Z_UserFeedback_byUuidIndex ON ZUSERFEEDBACK (ZUUID COLLATE BINARY ASC);

CREATE TABLE ACHANGE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCHANGETYPE INTEGER,
    ZENTITY INTEGER,
    ZENTITYPK INTEGER,
    ZTRANSACTIONID INTEGER,
    ZCOLUMNS BLOB,
    ZTOMBSTONE0 BLOB,
    ZTOMBSTONE1 BLOB,
    ZTOMBSTONE2 BLOB,
    ZTOMBSTONE3 BLOB,
    ZTOMBSTONE4 BLOB,
    ZTOMBSTONE5 BLOB
);

CREATE TABLE ATRANSACTION (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZAUTHORTS INTEGER,
    ZBUNDLEIDTS INTEGER,
    ZCONTEXTNAMETS INTEGER,
    ZPROCESSIDTS INTEGER,
    ZTIMESTAMP FLOAT,
    ZAUTHOR VARCHAR,
    ZBUNDLEID VARCHAR,
    ZCONTEXTNAME VARCHAR,
    ZPROCESSID VARCHAR,
    ZQUERYGEN BLOB
);

CREATE TABLE ATRANSACTIONSTRING (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZNAME VARCHAR
);

CREATE TABLE IF NOT EXISTS "Z_20CLUSTERREJECTEDPERSONS" (
    Z_20CLUSTERREJECTEDFACES INTEGER,
    Z_55CLUSTERREJECTEDPERSONS INTEGER,
    PRIMARY KEY (
        Z_20CLUSTERREJECTEDFACES,
        Z_55CLUSTERREJECTEDPERSONS
    )
);

CREATE TABLE IF NOT EXISTS "Z_20REJECTEDPERSONS" (
    Z_20REJECTEDFACES INTEGER,
    Z_55REJECTEDPERSONS INTEGER,
    PRIMARY KEY (Z_20REJECTEDFACES, Z_55REJECTEDPERSONS)
);

CREATE TABLE IF NOT EXISTS "Z_20REJECTEDPERSONSNEEDINGFACECROPS" (
    Z_20REJECTEDFACESNEEDINGFACECROPS INTEGER,
    Z_55REJECTEDPERSONSNEEDINGFACECROPS INTEGER,
    PRIMARY KEY (
        Z_20REJECTEDFACESNEEDINGFACECROPS,
        Z_55REJECTEDPERSONSNEEDINGFACECROPS
    )
);

CREATE TABLE IF NOT EXISTS "Z_30ALBUMLISTS" (
    Z_30ALBUMS INTEGER,
    Z_2ALBUMLISTS INTEGER,
    Z_FOK_30ALBUMS INTEGER,
    PRIMARY KEY (Z_30ALBUMS, Z_2ALBUMLISTS)
);

CREATE TABLE IF NOT EXISTS "Z_31ASSETS" (
    Z_31ALBUMS INTEGER,
    Z_3ASSETS INTEGER,
    Z_FOK_3ASSETS INTEGER,
    PRIMARY KEY (Z_31ALBUMS, Z_3ASSETS)
);

CREATE TABLE IF NOT EXISTS "Z_55INVALIDMERGECANDIDATES" (
    Z_55INVALIDMERGECANDIDATES INTEGER,
    REFLEXIVE INTEGER,
    PRIMARY KEY (Z_55INVALIDMERGECANDIDATES, REFLEXIVE)
);

CREATE TABLE IF NOT EXISTS "Z_55MERGECANDIDATES" (
    Z_55MERGECANDIDATES INTEGER,
    REFLEXIVE INTEGER,
    PRIMARY KEY (Z_55MERGECANDIDATES, REFLEXIVE)
);

CREATE TABLE IF NOT EXISTS "Z_55MERGECANDIDATESWITHCONFIDENCE" (
    Z_55MERGECANDIDATESWITHCONFIDENCE INTEGER,
    REFLEXIVE INTEGER,
    PRIMARY KEY (Z_55MERGECANDIDATESWITHCONFIDENCE, REFLEXIVE)
);

CREATE TABLE IF NOT EXISTS "Z_RT_Asset_boundedByRect_node"(nodeno INTEGER PRIMARY KEY, data);

CREATE TABLE IF NOT EXISTS "Z_RT_Asset_boundedByRect_parent"(nodeno INTEGER PRIMARY KEY, parentnode);

CREATE TABLE IF NOT EXISTS "Z_RT_Asset_boundedByRect_rowid"(rowid INTEGER PRIMARY KEY, nodeno);

CREATE TABLE ZADDITIONALASSETATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZALLOWEDFORANALYSIS INTEGER,
    ZCAMERACAPTUREDEVICE INTEGER,
    ZCLOUDAVALANCHEPICKTYPE INTEGER,
    ZCLOUDKINDSUBTYPE INTEGER,
    ZCLOUDRECOVERYSTATE INTEGER,
    ZCLOUDSTATERECOVERYATTEMPTSCOUNT INTEGER,
    ZDATECREATEDSOURCE INTEGER,
    ZDEFERREDPROCESSINGCANDIDATEOPTIONS INTEGER,
    ZDESTINATIONASSETCOPYSTATE INTEGER,
    ZDUPLICATEDETECTORPERCEPTUALPROCESSINGSTATE INTEGER,
    ZEMBEDDEDTHUMBNAILHEIGHT INTEGER,
    ZEMBEDDEDTHUMBNAILLENGTH INTEGER,
    ZEMBEDDEDTHUMBNAILOFFSET INTEGER,
    ZEMBEDDEDTHUMBNAILWIDTH INTEGER,
    ZFACEANALYSISVERSION INTEGER,
    ZIMPORTEDBY INTEGER,
    ZINFERREDTIMEZONEOFFSET INTEGER,
    ZLOCATIONHASH INTEGER,
    ZORIGINALFILESIZE INTEGER,
    ZORIGINALHEIGHT INTEGER,
    ZORIGINALORIENTATION INTEGER,
    ZORIGINALRESOURCECHOICE INTEGER,
    ZORIGINALWIDTH INTEGER,
    ZPENDINGPLAYCOUNT INTEGER,
    ZPENDINGSHARECOUNT INTEGER,
    ZPENDINGVIEWCOUNT INTEGER,
    ZPLAYCOUNT INTEGER,
    ZPTPTRASHEDSTATE INTEGER,
    ZREVERSELOCATIONDATAISVALID INTEGER,
    ZSCENEANALYSISISFROMPREVIEW INTEGER,
    ZSCENEANALYSISVERSION INTEGER,
    ZSHARECOUNT INTEGER,
    ZSHARETYPE INTEGER,
    ZSHIFTEDLOCATIONISVALID INTEGER,
    ZSYNDICATIONHISTORY INTEGER,
    ZTIMEZONEOFFSET INTEGER,
    ZUPLOADATTEMPTS INTEGER,
    ZVARIATIONSUGGESTIONSTATES INTEGER,
    ZVIDEOCPDISPLAYTIMESCALE INTEGER,
    ZVIDEOCPDISPLAYVALUE INTEGER,
    ZVIDEOCPDURATIONTIMESCALE INTEGER,
    ZVIEWCOUNT INTEGER,
    ZASSET INTEGER,
    ZASSETDESCRIPTION INTEGER,
    ZEDITEDIPTCATTRIBUTES INTEGER,
    ZMEDIAMETADATA INTEGER,
    ZSCENEPRINT INTEGER,
    ZUNMANAGEDADJUSTMENT INTEGER,
    ZALTERNATEIMPORTIMAGEDATE TIMESTAMP,
    ZGPSHORIZONTALACCURACY FLOAT,
    ZLASTUPLOADATTEMPTDATE TIMESTAMP,
    ZLASTVIEWEDDATE TIMESTAMP,
    ZSCENEANALYSISTIMESTAMP TIMESTAMP,
    ZACCESSIBILITYDESCRIPTION VARCHAR,
    ZADJUSTEDSTABLEHASH VARCHAR,
    ZDEFERREDPHOTOIDENTIFIER VARCHAR,
    ZEDITORBUNDLEID VARCHAR,
    ZEXIFTIMESTAMPSTRING VARCHAR,
    ZIMPORTSESSIONID VARCHAR,
    ZIMPORTEDBYBUNDLEIDENTIFIER VARCHAR,
    ZIMPORTEDBYDISPLAYNAME VARCHAR,
    ZORIGINALSTABLEHASH VARCHAR,
    ZMEDIAMETADATATYPE VARCHAR,
    ZMONTAGE VARCHAR,
    ZORIGINALASSETSUUID VARCHAR,
    ZORIGINALFILENAME VARCHAR,
    ZORIGINATINGASSETIDENTIFIER VARCHAR,
    ZPHOTOSTREAMTAGID VARCHAR,
    ZPUBLICGLOBALUUID VARCHAR,
    ZSHAREORIGINATOR VARCHAR,
    ZSOURCEASSETFORDUPLICATIONIDENTIFIER VARCHAR,
    ZSOURCEASSETFORDUPLICATIONSCOPEIDENTIFIER VARCHAR,
    ZSPATIALOVERCAPTUREGROUPIDENTIFIER VARCHAR,
    ZSYNDICATIONIDENTIFIER VARCHAR,
    ZTIMEZONENAME VARCHAR,
    ZTITLE VARCHAR,
    ZLIBRARYSCOPEASSETCONTRIBUTORSTOUPDATE BLOB,
    ZDISTANCEIDENTITY BLOB,
    ZFACEREGIONS BLOB,
    ZOBJECTSALIENCYRECTSDATA BLOB,
    ZORIGINALHASH BLOB,
    ZPLACEANNOTATIONDATA BLOB,
    ZREVERSELOCATIONDATA BLOB,
    ZSHIFTEDLOCATIONDATA BLOB,
    ZVIEWPRESENTATION INTEGER,
    ZIMAGEEMBEDDINGVERSION INTEGER,
    ZHASPEOPLESCENEMIDORGREATERCONFIDENCE INTEGER,
    ZSLEETISREVERSIBLE INTEGER
);

CREATE TABLE ZALBUMLIST (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZIDENTIFIER INTEGER,
    ZNEEDSREORDERINGNUMBER INTEGER,
    ZUUID VARCHAR
);

CREATE TABLE ZASSET (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZACTIVELIBRARYSCOPEPARTICIPATIONSTATE INTEGER,
    ZADJUSTMENTSSTATE INTEGER,
    ZAVALANCHEKIND INTEGER,
    ZAVALANCHEPICKTYPE INTEGER,
    ZBUNDLESCOPE INTEGER,
    ZCAMERAPROCESSINGADJUSTMENTSTATE INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDDOWNLOADREQUESTS INTEGER,
    ZCLOUDHASCOMMENTSBYME INTEGER,
    ZCLOUDHASCOMMENTSCONVERSATION INTEGER,
    ZCLOUDHASUNSEENCOMMENTS INTEGER,
    ZCLOUDISDELETABLE INTEGER,
    ZCLOUDISMYASSET INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCLOUDPLACEHOLDERKIND INTEGER,
    ZCOMPLETE INTEGER,
    ZCURRENTSLEETCAST INTEGER,
    ZDEFERREDPROCESSINGNEEDED INTEGER,
    ZDEPTHTYPE INTEGER,
    ZDERIVEDCAMERACAPTUREDEVICE INTEGER,
    ZDUPLICATEASSETVISIBILITYSTATE INTEGER,
    ZFACEAREAPOINTS INTEGER,
    ZFAVORITE INTEGER,
    ZHDRTYPE INTEGER,
    ZHEIGHT INTEGER,
    ZHIDDEN INTEGER,
    ZHIGHFRAMERATESTATE INTEGER,
    ZISDETECTEDSCREENSHOT INTEGER,
    ZISMAGICCARPET INTEGER,
    ZISRECENTLYSAVED INTEGER,
    ZKIND INTEGER,
    ZKINDSUBTYPE INTEGER,
    ZLIBRARYSCOPESHARESTATE INTEGER,
    ZORIENTATION INTEGER,
    ZPACKEDACCEPTABLECROPRECT INTEGER,
    ZPACKEDBADGEATTRIBUTES INTEGER,
    ZPACKEDPREFERREDCROPRECT INTEGER,
    ZPLAYBACKSTYLE INTEGER,
    ZPLAYBACKVARIATION INTEGER,
    ZSAVEDASSETTYPE INTEGER,
    ZSEARCHINDEXREBUILDSTATE INTEGER,
    ZSPATIALTYPE INTEGER,
    ZSYNDICATIONSTATE INTEGER,
    ZTHUMBNAILINDEX INTEGER,
    ZTRASHEDREASON INTEGER,
    ZTRASHEDSTATE INTEGER,
    ZVIDEOCPDURATIONVALUE INTEGER,
    ZVIDEOCPVISIBILITYSTATE INTEGER,
    ZVIDEODEFERREDPROCESSINGNEEDED INTEGER,
    ZVIDEOKEYFRAMETIMESCALE INTEGER,
    ZVIDEOKEYFRAMEVALUE INTEGER,
    ZVISIBILITYSTATE INTEGER,
    ZWIDTH INTEGER,
    ZADDITIONALATTRIBUTES INTEGER,
    ZCLOUDFEEDASSETSENTRY INTEGER,
    ZCOMPUTESYNCATTRIBUTES INTEGER,
    ZCOMPUTEDATTRIBUTES INTEGER,
    ZCONVERSATION INTEGER,
    ZDAYGROUPHIGHLIGHTBEINGASSETS INTEGER,
    ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS INTEGER,
    ZDAYGROUPHIGHLIGHTBEINGKEYASSETPRIVATE INTEGER,
    ZDAYGROUPHIGHLIGHTBEINGKEYASSETSHARED INTEGER,
    ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS INTEGER,
    ZDAYHIGHLIGHTBEINGCOLLAGEASSETSMIXED INTEGER,
    ZDAYHIGHLIGHTBEINGCOLLAGEASSETSPRIVATE INTEGER,
    ZDAYHIGHLIGHTBEINGCOLLAGEASSETSSHARED INTEGER,
    ZDUPLICATEMETADATAMATCHINGALBUM INTEGER,
    ZDUPLICATEPERCEPTUALMATCHINGALBUM INTEGER,
    ZEXTENDEDATTRIBUTES INTEGER,
    ZGENERATEDASSETDESCRIPTION INTEGER,
    ZHIGHLIGHTBEINGASSETS INTEGER,
    ZHIGHLIGHTBEINGEXTENDEDASSETS INTEGER,
    ZHIGHLIGHTBEINGKEYASSETPRIVATE INTEGER,
    ZHIGHLIGHTBEINGKEYASSETSHARED INTEGER,
    ZHIGHLIGHTBEINGSUMMARYASSETS INTEGER,
    ZIMPORTSESSION INTEGER,
    ZLIBRARYSCOPE INTEGER,
    ZMASTER INTEGER,
    ZMEDIAANALYSISATTRIBUTES INTEGER,
    ZMOMENT INTEGER,
    ZMOMENTSHARE INTEGER,
    ZMONTHHIGHLIGHTBEINGKEYASSETPRIVATE INTEGER,
    ZMONTHHIGHLIGHTBEINGKEYASSETSHARED INTEGER,
    ZPHOTOANALYSISATTRIBUTES INTEGER,
    ZTRASHEDBYPARTICIPANT INTEGER,
    ZYEARHIGHLIGHTBEINGKEYASSETPRIVATE INTEGER,
    ZYEARHIGHLIGHTBEINGKEYASSETSHARED INTEGER,
    Z_FOK_CLOUDFEEDASSETSENTRY INTEGER,
    Z_FOK_DAYHIGHLIGHTBEINGCOLLAGEASSETSPRIVATE INTEGER,
    Z_FOK_DAYHIGHLIGHTBEINGCOLLAGEASSETSMIXED INTEGER,
    Z_FOK_DAYHIGHLIGHTBEINGCOLLAGEASSETSSHARED INTEGER,
    ZADDEDDATE TIMESTAMP,
    ZADJUSTMENTTIMESTAMP TIMESTAMP,
    ZANALYSISSTATEMODIFICATIONDATE TIMESTAMP,
    ZCLOUDBATCHPUBLISHDATE TIMESTAMP,
    ZCLOUDLASTVIEWEDCOMMENTDATE TIMESTAMP,
    ZCLOUDSERVERPUBLISHDATE TIMESTAMP,
    ZCURATIONSCORE FLOAT,
    ZDATECREATED TIMESTAMP,
    ZDURATION FLOAT,
    ZFACEADJUSTMENTVERSION TIMESTAMP,
    ZHDRGAIN FLOAT,
    ZHIGHLIGHTVISIBILITYSCORE FLOAT,
    ZICONICSCORE FLOAT,
    ZLASTSHAREDDATE TIMESTAMP,
    ZLATITUDE FLOAT,
    ZLONGITUDE FLOAT,
    ZMODIFICATIONDATE TIMESTAMP,
    ZOVERALLAESTHETICSCORE FLOAT,
    ZPROMOTIONSCORE FLOAT,
    ZSORTTOKEN FLOAT,
    ZSTICKERCONFIDENCESCORE FLOAT,
    ZTRASHEDDATE TIMESTAMP,
    ZAVALANCHEUUID VARCHAR,
    ZCAPTURESESSIONIDENTIFIER VARCHAR,
    ZCLOUDASSETGUID VARCHAR,
    ZCLOUDBATCHID VARCHAR,
    ZCLOUDCOLLECTIONGUID VARCHAR,
    ZCLOUDOWNERHASHEDPERSONID VARCHAR,
    ZDELETEREASON VARCHAR,
    ZDIRECTORY VARCHAR,
    ZFILENAME VARCHAR,
    ZMEDIAGROUPUUID VARCHAR,
    ZORIGINALCOLORSPACE VARCHAR,
    ZUNIFORMTYPEIDENTIFIER VARCHAR,
    ZUUID VARCHAR,
    ZIMAGEREQUESTHINTS BLOB,
    ZLOCATIONDATA BLOB
);

CREATE TABLE ZASSETANALYSISSTATE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZANALYSISSTATE INTEGER,
    ZWORKERFLAGS INTEGER,
    ZWORKERTYPE INTEGER,
    ZASSET INTEGER,
    ZIGNOREUNTILDATE TIMESTAMP,
    ZLASTIGNOREDDATE TIMESTAMP,
    ZSORTTOKEN FLOAT,
    ZASSETUUID VARCHAR
);

CREATE TABLE ZASSETCONTRIBUTOR (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZPARTICIPANT INTEGER,
    Z3LIBRARYSCOPEASSETCONTRIBUTORS INTEGER
);

CREATE TABLE ZASSETDESCRIPTION (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZASSETATTRIBUTES INTEGER,
    ZLONGDESCRIPTION VARCHAR
);

CREATE TABLE ZBACKGROUNDJOBWORKITEM (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZJOBFLAGS INTEGER,
    ZJOBTYPE INTEGER,
    ZDELAYUNTILDATE TIMESTAMP,
    ZTIMESTAMP TIMESTAMP,
    ZIDENTIFIER VARCHAR
);

CREATE TABLE ZCHARACTERRECOGNITIONATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZALGORITHMVERSION INTEGER,
    ZMEDIAANALYSISASSETATTRIBUTES INTEGER,
    ZADJUSTMENTVERSION TIMESTAMP,
    ZCHARACTERRECOGNITIONDATA BLOB,
    ZMACHINEREADABLECODEDATA BLOB
);

CREATE TABLE ZCLOUDFEEDENTRY (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZENTRYPRIORITYNUMBER INTEGER,
    ZENTRYTYPENUMBER INTEGER,
    ZENTRYDATE TIMESTAMP,
    ZENTRYALBUMGUID VARCHAR,
    ZENTRYINVITATIONRECORDGUID VARCHAR,
    ZENTRYCLOUDASSETGUID VARCHAR,
    ZENTRYISMINE INTEGER
);

CREATE TABLE ZCLOUDMASTER (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZFULLSIZEJPEGSOURCE INTEGER,
    ZIMPORTEDBY INTEGER,
    ZORIGINALORIENTATION INTEGER,
    ZPLACEHOLDERSTATE INTEGER,
    ZVIDEOFRAMERATE INTEGER,
    ZMEDIAMETADATA INTEGER,
    ZMOMENTSHARE INTEGER,
    ZCREATIONDATE TIMESTAMP,
    ZIMPORTDATE TIMESTAMP,
    ZCLOUDMASTERGUID VARCHAR,
    ZCODECNAME VARCHAR,
    ZIMPORTSESSIONID VARCHAR,
    ZIMPORTEDBYBUNDLEIDENTIFIER VARCHAR,
    ZIMPORTEDBYDISPLAYNAME VARCHAR,
    ZMEDIAMETADATATYPE VARCHAR,
    ZORIGINALFILENAME VARCHAR,
    ZORIGINATINGASSETIDENTIFIER VARCHAR,
    ZSOURCEMASTERFORDUPLICATIONIDENTIFIER VARCHAR,
    ZSOURCEMASTERFORDUPLICATIONSCOPEIDENTIFIER VARCHAR,
    ZUNIFORMTYPEIDENTIFIER VARCHAR
);

CREATE TABLE ZCLOUDMASTERMEDIAMETADATA (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZADDITIONALASSETATTRIBUTES INTEGER,
    ZCLOUDMASTER INTEGER,
    ZDATA BLOB
);

CREATE TABLE ZCLOUDRESOURCE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZFILESIZE INTEGER,
    ZHEIGHT INTEGER,
    ZISAVAILABLE INTEGER,
    ZISLOCALLYAVAILABLE INTEGER,
    ZPREFETCHCOUNT INTEGER,
    ZSOURCETYPE INTEGER,
    ZTYPE INTEGER,
    ZWIDTH INTEGER,
    ZASSET INTEGER,
    ZCLOUDMASTER INTEGER,
    ZDATECREATED TIMESTAMP,
    ZLASTONDEMANDDOWNLOADDATE TIMESTAMP,
    ZLASTPREFETCHDATE TIMESTAMP,
    ZPRUNEDAT TIMESTAMP,
    ZASSETUUID VARCHAR,
    ZFILEPATH VARCHAR,
    ZFINGERPRINT VARCHAR,
    ZITEMIDENTIFIER VARCHAR,
    ZUNIFORMTYPEIDENTIFIER VARCHAR
);

CREATE TABLE ZCLOUDSHAREDALBUMINVITATIONRECORD (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZINVITATIONSTATE INTEGER,
    ZINVITATIONSTATELOCAL INTEGER,
    ZINVITEEEMAILKEY INTEGER,
    ZISMINE INTEGER,
    ZALBUM INTEGER,
    Z_FOK_ALBUM INTEGER,
    ZINVITEESUBSCRIPTIONDATE TIMESTAMP,
    ZALBUMGUID VARCHAR,
    ZCLOUDGUID VARCHAR,
    ZINVITEEFIRSTNAME VARCHAR,
    ZINVITEEFULLNAME VARCHAR,
    ZINVITEEHASHEDPERSONID VARCHAR,
    ZINVITEELASTNAME VARCHAR,
    ZUUID VARCHAR
);

CREATE TABLE ZCLOUDSHAREDCOMMENT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZISBATCHCOMMENT INTEGER,
    ZISCAPTION INTEGER,
    ZISDELETABLE INTEGER,
    ZISLIKE INTEGER,
    ZISMYCOMMENT INTEGER,
    ZCLOUDFEEDCOMMENTENTRY INTEGER,
    ZCLOUDFEEDLIKECOMMENTENTRY INTEGER,
    ZCOMMENTEDASSET INTEGER,
    ZLIKEDASSET INTEGER,
    Z_FOK_CLOUDFEEDCOMMENTENTRY INTEGER,
    Z_FOK_CLOUDFEEDLIKECOMMENTENTRY INTEGER,
    ZCOMMENTCLIENTDATE TIMESTAMP,
    ZCOMMENTDATE TIMESTAMP,
    ZCLOUDGUID VARCHAR,
    ZCOMMENTTEXT VARCHAR,
    ZCOMMENTTYPE VARCHAR,
    ZCOMMENTERHASHEDPERSONID VARCHAR
);

CREATE TABLE ZCOMPUTEDASSETATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZASSET INTEGER,
    ZBEHAVIORALSCORE FLOAT,
    ZFAILURESCORE FLOAT,
    ZHARMONIOUSCOLORSCORE FLOAT,
    ZIMMERSIVENESSSCORE FLOAT,
    ZINTERACTIONSCORE FLOAT,
    ZINTERESTINGSUBJECTSCORE FLOAT,
    ZINTRUSIVEOBJECTPRESENCESCORE FLOAT,
    ZLIVELYCOLORSCORE FLOAT,
    ZLOWLIGHT FLOAT,
    ZNOISESCORE FLOAT,
    ZPLEASANTCAMERATILTSCORE FLOAT,
    ZPLEASANTCOMPOSITIONSCORE FLOAT,
    ZPLEASANTLIGHTINGSCORE FLOAT,
    ZPLEASANTPATTERNSCORE FLOAT,
    ZPLEASANTPERSPECTIVESCORE FLOAT,
    ZPLEASANTPOSTPROCESSINGSCORE FLOAT,
    ZPLEASANTREFLECTIONSSCORE FLOAT,
    ZPLEASANTSYMMETRYSCORE FLOAT,
    ZSHARPLYFOCUSEDSUBJECTSCORE FLOAT,
    ZTASTEFULLYBLURREDSCORE FLOAT,
    ZWELLCHOSENSUBJECTSCORE FLOAT,
    ZWELLFRAMEDSUBJECTSCORE FLOAT,
    ZWELLTIMEDSHOTSCORE FLOAT
);

CREATE TABLE ZCOMPUTESYNCATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZLOCALANALYSISMAJORVERSION INTEGER,
    ZLOCALANALYSISSTAGE INTEGER,
    ZASSET INTEGER,
    ZCLOUDCOMPUTESTATELASTUPDATEDDATE TIMESTAMP,
    ZCLOUDCOMPUTESTATEADJUSTMENTFINGERPRINT VARCHAR,
    ZCLOUDCOMPUTESTATEVERSION VARCHAR
);

CREATE TABLE ZDEFERREDREBUILDFACE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLOUDNAMESOURCE INTEGER,
    ZCLUSTERREJECTED INTEGER,
    ZFACEALGORITHMVERSION INTEGER,
    ZHIDDEN INTEGER,
    ZMANUAL INTEGER,
    ZNAMESOURCE INTEGER,
    ZREJECTED INTEGER,
    ZREPRESENTATIVE INTEGER,
    ZCENTERX FLOAT,
    ZCENTERY FLOAT,
    ZSIZE FLOAT,
    ZASSETCLOUDGUID VARCHAR,
    ZASSETUUID VARCHAR,
    ZFACEUUID VARCHAR,
    ZPERSONUUID VARCHAR,
    ZUUID VARCHAR
);

CREATE TABLE ZDETECTEDFACE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZAGETYPE INTEGER,
    ZASSETVISIBLE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCLOUDNAMESOURCE INTEGER,
    ZCLUSTERSEQUENCENUMBER INTEGER,
    ZCONFIRMEDFACECROPGENERATIONSTATE INTEGER,
    ZDETECTIONTYPE INTEGER,
    ZETHNICITYTYPE INTEGER,
    ZEYEMAKEUPTYPE INTEGER,
    ZEYESSTATE INTEGER,
    ZFACEALGORITHMVERSION INTEGER,
    ZFACEEXPRESSIONTYPE INTEGER,
    ZFACIALHAIRTYPE INTEGER,
    ZGAZETYPE INTEGER,
    ZGENDERTYPE INTEGER,
    ZGLASSESTYPE INTEGER,
    ZHAIRCOLORTYPE INTEGER,
    ZHAIRTYPE INTEGER,
    ZHASFACEMASK INTEGER,
    ZHASSMILE INTEGER,
    ZHEADGEARTYPE INTEGER,
    ZHIDDEN INTEGER,
    ZISINTRASH INTEGER,
    ZISLEFTEYECLOSED INTEGER,
    ZISRIGHTEYECLOSED INTEGER,
    ZLIPMAKEUPTYPE INTEGER,
    ZMANUAL INTEGER,
    ZNAMESOURCE INTEGER,
    ZPOSETYPE INTEGER,
    ZQUALITYMEASURE INTEGER,
    ZSKINTONETYPE INTEGER,
    ZSMILETYPE INTEGER,
    ZSOURCEHEIGHT INTEGER,
    ZSOURCEWIDTH INTEGER,
    ZTRAININGTYPE INTEGER,
    ZVIPMODELTYPE INTEGER,
    ZVUOBSERVATIONID INTEGER,
    ZASSETFORFACE INTEGER,
    ZASSETFORTEMPORALDETECTEDFACES INTEGER,
    ZASSETFORTORSO INTEGER,
    ZFACECROP INTEGER,
    ZFACEGROUP INTEGER,
    ZFACEGROUPBEINGKEYFACE INTEGER,
    ZFACEPRINT INTEGER,
    ZPERSONBEINGKEYFACE INTEGER,
    ZPERSONFORFACE INTEGER,
    ZPERSONFORTEMPORALDETECTEDFACES INTEGER,
    ZPERSONFORTORSO INTEGER,
    ZADJUSTMENTVERSION TIMESTAMP,
    ZBLURSCORE FLOAT,
    ZBODYCENTERX FLOAT,
    ZBODYCENTERY FLOAT,
    ZBODYHEIGHT FLOAT,
    ZBODYWIDTH FLOAT,
    ZCENTERX FLOAT,
    ZCENTERY FLOAT,
    ZDURATION FLOAT,
    ZGAZEANGLE FLOAT,
    ZGAZECENTERX FLOAT,
    ZGAZECENTERY FLOAT,
    ZGAZECONFIDENCE FLOAT,
    ZPOSEYAW FLOAT,
    ZQUALITY FLOAT,
    ZROLL FLOAT,
    ZSIZE FLOAT,
    ZSTARTTIME FLOAT,
    ZGAZERECTSTRING VARCHAR,
    ZGROUPINGIDENTIFIER VARCHAR,
    ZMASTERIDENTIFIER VARCHAR,
    ZUUID VARCHAR
);

CREATE TABLE ZDETECTEDFACEGROUP (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZPERSONBUILDERSTATE INTEGER,
    ZUNNAMEDFACECOUNT INTEGER,
    ZASSOCIATEDPERSON INTEGER,
    ZKEYFACE INTEGER,
    ZUUID VARCHAR
);

CREATE TABLE ZDETECTEDFACEPRINT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZFACEPRINTVERSION INTEGER,
    ZFACE INTEGER,
    ZDATA BLOB
);

CREATE TABLE ZDETECTIONTRAIT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZTYPE INTEGER,
    ZVALUE INTEGER,
    ZDETECTION INTEGER,
    ZDURATION FLOAT,
    ZSCORE FLOAT,
    ZSTARTTIME FLOAT
);

CREATE TABLE ZEDITEDIPTCATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZASSETATTRIBUTES INTEGER,
    ZACTIONADVISED VARCHAR,
    ZAUDIODURATION VARCHAR,
    ZAUDIOOUTCUE VARCHAR,
    ZAUDIOSAMPLINGRATE VARCHAR,
    ZAUDIOSAMPLINGRES VARCHAR,
    ZAUDIOTYPE VARCHAR,
    ZBYLINE VARCHAR,
    ZBYLINETITLE VARCHAR,
    ZCAPTION VARCHAR,
    ZCATEGORY VARCHAR,
    ZCIADRCITY VARCHAR,
    ZCIADRCTRY VARCHAR,
    ZCIADREXTADR VARCHAR,
    ZCIADRPCODE VARCHAR,
    ZCIADRREGION VARCHAR,
    ZCIEMAILWORK VARCHAR,
    ZCITELWORK VARCHAR,
    ZCIURLWORK VARCHAR,
    ZCITY VARCHAR,
    ZCONTACT VARCHAR,
    ZCONTENTLOCATIONCODE VARCHAR,
    ZCONTENTLOCATIONNAME VARCHAR,
    ZCOPYRIGHTNOTICE VARCHAR,
    ZCOUNTRYPRIMARYLOCATIONCODE VARCHAR,
    ZCOUNTRYPRIMARYLOCATIONNAME VARCHAR,
    ZCREATORCONTACTINFO VARCHAR,
    ZCREDIT VARCHAR,
    ZDATECREATED VARCHAR,
    ZDIGITALCREATIONDATE VARCHAR,
    ZDIGITALCREATIONTIME VARCHAR,
    ZEDITSTATUS VARCHAR,
    ZEDITORIALUPDATE VARCHAR,
    ZEXPIRATIONDATE VARCHAR,
    ZEXPIRATIONTIME VARCHAR,
    ZFIXTUREIDENTIFIER VARCHAR,
    ZHEADLINE VARCHAR,
    ZIMAGEORIENTATION VARCHAR,
    ZIMAGETYPE VARCHAR,
    ZKEYWORDS VARCHAR,
    ZLANGUAGEIDENTIFIER VARCHAR,
    ZOBJECTATTRIBUTEREFERENCE VARCHAR,
    ZOBJECTCYCLE VARCHAR,
    ZOBJECTNAME VARCHAR,
    ZOBJECTTYPEREFERENCE VARCHAR,
    ZORIGINALTRANSMISSIONREFERENCE VARCHAR,
    ZORIGINATINGPROGRAM VARCHAR,
    ZPROGRAMVERSION VARCHAR,
    ZPROVINCESTATE VARCHAR,
    ZREFERENCEDATE VARCHAR,
    ZREFERENCENUMBER VARCHAR,
    ZREFERENCESERVICE VARCHAR,
    ZRELEASEDATE VARCHAR,
    ZRELEASETIME VARCHAR,
    ZSCENE VARCHAR,
    ZSOURCE VARCHAR,
    ZSPECIALINSTRUCTIONS VARCHAR,
    ZSTARRATING VARCHAR,
    ZSUBLOCATION VARCHAR,
    ZSUBJECTREFERENCE VARCHAR,
    ZSUPPLEMENTALCATEGORY VARCHAR,
    ZTIMECREATED VARCHAR,
    ZURGENCY VARCHAR,
    ZUSAGETERMS VARCHAR,
    ZWRITEREDITOR VARCHAR,
    ZDATA BLOB,
    ZDIGITALSOURCETYPE VARCHAR
);

CREATE TABLE ZEXTENDEDATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZFLASHFIRED INTEGER,
    ZFOCALLENGTHIN35MM INTEGER,
    ZISO INTEGER,
    ZMETERINGMODE INTEGER,
    ZORIENTATION INTEGER,
    ZSAMPLERATE INTEGER,
    ZSLUSHPRESET INTEGER,
    ZSLUSHVERSION INTEGER,
    ZTIMEZONEOFFSET INTEGER,
    ZTRACKFORMAT INTEGER,
    ZWHITEBALANCE INTEGER,
    ZASSET INTEGER,
    ZAPERTURE FLOAT,
    ZBITRATE FLOAT,
    ZDATECREATED TIMESTAMP,
    ZDIGITALZOOMRATIO FLOAT,
    ZDURATION FLOAT,
    ZEXPOSUREBIAS FLOAT,
    ZFOCALLENGTH FLOAT,
    ZFPS FLOAT,
    ZLATITUDE FLOAT,
    ZLONGITUDE FLOAT,
    ZSHUTTERSPEED FLOAT,
    ZSLUSHSCENEBIAS FLOAT,
    ZSLUSHWARMTHBIAS FLOAT,
    ZCAMERAMAKE VARCHAR,
    ZCAMERAMODEL VARCHAR,
    ZCODEC VARCHAR,
    ZLENSMODEL VARCHAR,
    ZTIMEZONENAME VARCHAR,
    ZSLEETTONEBIAS FLOAT,
    ZSLEETINTENSITY FLOAT,
    ZSLEETCOLORBIAS FLOAT,
    ZSLEETRENDERINGVERSION INTEGER,
    ZGENERATIVEAITYPE INTEGER,
    ZSLEETCAST INTEGER,
    ZCREDIT VARCHAR
);

CREATE TABLE ZFACECROP (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCLOUDTYPE INTEGER,
    ZSTATE INTEGER,
    ZTYPE INTEGER,
    ZASSET INTEGER,
    ZFACE INTEGER,
    ZPERSON INTEGER,
    ZINVALIDMERGECANDIDATEPERSONUUID VARCHAR,
    ZUUID VARCHAR,
    ZRESOURCEDATA BLOB
);

CREATE TABLE ZFILESYSTEMBOOKMARK (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZRESOURCE INTEGER,
    ZPATHRELATIVETOVOLUME VARCHAR,
    ZBOOKMARKDATA BLOB
);

CREATE TABLE ZFILESYSTEMVOLUME (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZNAME VARCHAR,
    ZUUID VARCHAR,
    ZVOLUMEUUIDSTRING VARCHAR
);

CREATE TABLE ZGENERATEDASSETDESCRIPTION (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZANALYSISSOURCETYPE INTEGER,
    ZANALYSISVERSION INTEGER,
    ZASSET INTEGER,
    ZANALYSISTIMESTAMP TIMESTAMP,
    ZDESCRIPTIONTEXT VARCHAR
);

CREATE TABLE ZGENERICALBUM (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCACHEDCOUNT INTEGER,
    ZCACHEDPHOTOSCOUNT INTEGER,
    ZCACHEDVIDEOSCOUNT INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCUSTOMSORTASCENDING INTEGER,
    ZCUSTOMSORTKEY INTEGER,
    ZISPINNED INTEGER,
    ZISPROTOTYPE INTEGER,
    ZKIND INTEGER,
    ZPENDINGITEMSCOUNT INTEGER,
    ZPENDINGITEMSTYPE INTEGER,
    ZPRIVACYSTATE INTEGER,
    ZSYNCEVENTORDERKEY INTEGER,
    ZTRASHEDSTATE INTEGER,
    ZCUSTOMKEYASSET INTEGER,
    ZPARENTFOLDER INTEGER,
    ZSEARCHINDEXREBUILDSTATE INTEGER,
    ZCLOUDALBUMSUBTYPE INTEGER,
    ZCLOUDMULTIPLECONTRIBUTORSENABLED INTEGER,
    ZCLOUDMULTIPLECONTRIBUTORSENABLEDLOCAL INTEGER,
    ZCLOUDNOTIFICATIONSENABLED INTEGER,
    ZCLOUDOWNEREMAILKEY INTEGER,
    ZCLOUDOWNERISWHITELISTED INTEGER,
    ZCLOUDPUBLICURLENABLED INTEGER,
    ZCLOUDPUBLICURLENABLEDLOCAL INTEGER,
    ZCLOUDRELATIONSHIPSTATE INTEGER,
    ZCLOUDRELATIONSHIPSTATELOCAL INTEGER,
    ZHASUNSEENCONTENT INTEGER,
    ZISOWNED INTEGER,
    ZUNSEENASSETSCOUNT INTEGER,
    ZDUPLICATETYPE INTEGER,
    ZPROCESSINGVERSION INTEGER,
    ZKEYASSETFACEIDENTIFIER INTEGER,
    ZKEYASSETFACETHUMBNAILINDEX INTEGER,
    ZSYNDICATE INTEGER,
    ZSEARCHINDEXREBUILDSTATE1 INTEGER,
    Z_FOK_PARENTFOLDER INTEGER,
    ZCREATIONDATE TIMESTAMP,
    ZENDDATE TIMESTAMP,
    ZSTARTDATE TIMESTAMP,
    ZTRASHEDDATE TIMESTAMP,
    ZCLOUDCREATIONDATE TIMESTAMP,
    ZCLOUDLASTCONTRIBUTIONDATE TIMESTAMP,
    ZCLOUDLASTINTERESTINGCHANGEDATE TIMESTAMP,
    ZCLOUDSUBSCRIPTIONDATE TIMESTAMP,
    ZCLOUDGUID VARCHAR,
    ZIMPORTSESSIONID VARCHAR,
    ZIMPORTEDBYBUNDLEIDENTIFIER VARCHAR,
    ZTITLE VARCHAR,
    ZUUID VARCHAR,
    ZCLOUDOWNERFIRSTNAME VARCHAR,
    ZCLOUDOWNERFULLNAME VARCHAR,
    ZCLOUDOWNERHASHEDPERSONID VARCHAR,
    ZCLOUDOWNERLASTNAME VARCHAR,
    ZCLOUDPERSONID VARCHAR,
    ZPUBLICURL VARCHAR,
    ZPROJECTDOCUMENTTYPE VARCHAR,
    ZPROJECTEXTENSIONIDENTIFIER VARCHAR,
    ZPROJECTRENDERUUID VARCHAR,
    ZCUSTOMQUERYTYPE VARCHAR,
    ZCLOUDMETADATA BLOB,
    ZUSERQUERYDATA BLOB,
    ZPROJECTDATA BLOB,
    ZCUSTOMQUERYPARAMETERS BLOB
);

CREATE TABLE ZGLOBALKEYVALUE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZBOOLVALUE INTEGER,
    ZINTEGERVALUE INTEGER,
    ZTYPE INTEGER,
    ZDATEVALUE TIMESTAMP,
    ZDOUBLEVALUE FLOAT,
    ZKEY VARCHAR,
    ZSTRINGVALUE VARCHAR,
    ZANYVALUE BLOB
);

CREATE TABLE ZGRAPHEDGE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZPRIMARYLABEL INTEGER,
    ZSOURCEASSET INTEGER,
    ZSOURCEMOMENT INTEGER,
    ZSOURCENODE INTEGER,
    ZSOURCEPERSON INTEGER,
    ZTARGETASSET INTEGER,
    ZTARGETMOMENT INTEGER,
    ZTARGETNODE INTEGER,
    ZTARGETPERSON INTEGER
);

CREATE TABLE ZGRAPHEDGEVALUE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZBOOLEANVALUE INTEGER,
    ZINTVALUE INTEGER,
    ZEDGE INTEGER,
    ZDATEVALUE TIMESTAMP,
    ZFLOATVALUE FLOAT,
    ZSTRINGVALUE VARCHAR,
    ZVALUENAME VARCHAR
);

CREATE TABLE ZGRAPHLABEL (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCODE INTEGER
);

CREATE TABLE ZGRAPHNODE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCHANGEFLAG0 INTEGER,
    ZCHANGEFLAG1 INTEGER,
    ZCHANGEFLAG2 INTEGER,
    ZCHANGEFLAG3 INTEGER,
    ZCHANGEFLAG4 INTEGER,
    ZCHANGEFLAG5 INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCPLCHANGEFLAG INTEGER,
    ZPRIMARYLABELCODE INTEGER,
    ZPRIMARYLABEL INTEGER,
    ZUUID VARCHAR
);

CREATE TABLE ZGRAPHNODEVALUE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZBOOLEANVALUE INTEGER,
    ZINTVALUE INTEGER,
    ZNODE INTEGER,
    ZDATEVALUE TIMESTAMP,
    ZFLOATVALUE FLOAT,
    ZSTRINGVALUE VARCHAR,
    ZVALUENAME VARCHAR
);

CREATE TABLE ZINTERNALRESOURCE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCLOUDPREFETCHCOUNT INTEGER,
    ZCLOUDSOURCETYPE INTEGER,
    ZDATALENGTH INTEGER,
    ZDATASTORECLASSID INTEGER,
    ZDATASTORESUBTYPE INTEGER,
    ZFILEID INTEGER,
    ZLOCALAVAILABILITY INTEGER,
    ZLOCALAVAILABILITYTARGET INTEGER,
    ZPTPTRASHEDSTATE INTEGER,
    ZRECIPEID INTEGER,
    ZREMOTEAVAILABILITY INTEGER,
    ZREMOTEAVAILABILITYTARGET INTEGER,
    ZRESOURCETYPE INTEGER,
    ZSIDECARINDEX INTEGER,
    ZTRASHEDSTATE INTEGER,
    ZUNORIENTEDHEIGHT INTEGER,
    ZUNORIENTEDWIDTH INTEGER,
    ZUTICONFORMANCEHINT INTEGER,
    ZVERSION INTEGER,
    ZASSET INTEGER,
    ZFILESYSTEMBOOKMARK INTEGER,
    ZFILESYSTEMVOLUME INTEGER,
    ZTRANSIENTCLOUDMASTER INTEGER,
    ZCLOUDLASTONDEMANDDOWNLOADDATE TIMESTAMP,
    ZCLOUDLASTPREFETCHDATE TIMESTAMP,
    ZCLOUDMASTERDATECREATED TIMESTAMP,
    ZCLOUDPRUNEDAT TIMESTAMP,
    ZTRASHEDDATE TIMESTAMP,
    ZCLOUDDELETEASSETUUIDWITHRESOURCETYPE VARCHAR,
    ZCODECFOURCHARCODENAME VARCHAR,
    ZCOMPACTUTI VARCHAR,
    ZFINGERPRINT VARCHAR,
    ZDATASTOREKEYDATA BLOB,
    ZSTABLEHASH VARCHAR
);

CREATE TABLE ZKEYWORD (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZSHORTCUT VARCHAR,
    ZTITLE VARCHAR,
    ZUUID VARCHAR
);

CREATE TABLE ZLEGACYFACE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZIDENTIFIER INTEGER,
    ZASSET INTEGER,
    ZALBUMUUID VARCHAR,
    ZRELATIVERECTVALUE BLOB
);

CREATE TABLE ZLIMITEDLIBRARYFETCHFILTER (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZAPPLICATIONIDENTIFIER VARCHAR,
    ZDESIGNATEDREQUIREMENT VARCHAR,
    ZFETCHFILTERDATA BLOB
);

CREATE TABLE ZMEDIAANALYSISASSETATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZANIMATEDSTICKERRANGEDURATIONTIMESCALE INTEGER,
    ZANIMATEDSTICKERRANGEDURATIONVALUE INTEGER,
    ZANIMATEDSTICKERRANGESTARTTIMESCALE INTEGER,
    ZANIMATEDSTICKERRANGESTARTVALUE INTEGER,
    ZAUDIOCLASSIFICATION INTEGER,
    ZBESTVIDEORANGEDURATIONTIMESCALE INTEGER,
    ZBESTVIDEORANGEDURATIONVALUE INTEGER,
    ZBESTVIDEORANGESTARTTIMESCALE INTEGER,
    ZBESTVIDEORANGESTARTVALUE INTEGER,
    ZFACECOUNT INTEGER,
    ZMEDIAANALYSISVERSION INTEGER,
    ZPACKEDBESTPLAYBACKRECT INTEGER,
    ZPROBABLEROTATIONDIRECTION INTEGER,
    ZSCREENTIMEDEVICEIMAGESENSITIVITY INTEGER,
    ZSYNDICATIONPROCESSINGVALUE INTEGER,
    ZSYNDICATIONPROCESSINGVERSION INTEGER,
    ZVAANALYSISVERSION INTEGER,
    ZASSET INTEGER,
    ZCHARACTERRECOGNITIONATTRIBUTES INTEGER,
    ZVISUALSEARCHATTRIBUTES INTEGER,
    ZACTIVITYSCORE FLOAT,
    ZAUDIOSCORE FLOAT,
    ZAUTOPLAYSUGGESTIONSCORE FLOAT,
    ZBLURRINESSSCORE FLOAT,
    ZEXPOSURESCORE FLOAT,
    ZMEDIAANALYSISTIMESTAMP TIMESTAMP,
    ZPROBABLEROTATIONDIRECTIONCONFIDENCE FLOAT,
    ZSETTLINGEFFECTSCORE FLOAT,
    ZVAANALYSISTIMESTAMP TIMESTAMP,
    ZVIDEOSCORE FLOAT,
    ZVIDEOSTICKERSUGGESTIONSCORE FLOAT,
    ZWALLPAPERSCORE FLOAT,
    ZCOLORNORMALIZATIONDATA BLOB,
    ZMEDIAANALYSISIMAGEVERSION INTEGER,
    ZIMAGECAPTIONVERSION INTEGER,
    ZVIDEOCAPTIONVERSION INTEGER,
    ZVALOCATIONANALYSISVERSION INTEGER
);

CREATE TABLE ZMEMORY (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCATEGORY INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZFAVORITE INTEGER,
    ZFEATUREDSTATE INTEGER,
    ZNOTIFICATIONSTATE INTEGER,
    ZPENDINGPLAYCOUNT INTEGER,
    ZPENDINGSHARECOUNT INTEGER,
    ZPENDINGSTATE INTEGER,
    ZPENDINGVIEWCOUNT INTEGER,
    ZPHOTOSGRAPHVERSION INTEGER,
    ZPLAYCOUNT INTEGER,
    ZREJECTED INTEGER,
    ZSEARCHINDEXREBUILDSTATE INTEGER,
    ZSHARECOUNT INTEGER,
    ZSHARINGCOMPOSITION INTEGER,
    ZSTORYCOLORGRADEKIND INTEGER,
    ZSTORYSERIALIZEDTITLECATEGORY INTEGER,
    ZSUBCATEGORY INTEGER,
    ZSYNDICATEDCONTENTSTATE INTEGER,
    ZUSERACTIONOPTIONS INTEGER,
    ZVIEWCOUNT INTEGER,
    ZKEYASSET INTEGER,
    ZCREATIONDATE TIMESTAMP,
    ZLASTENRICHMENTDATE TIMESTAMP,
    ZLASTMOVIEPLAYEDDATE TIMESTAMP,
    ZLASTVIEWEDDATE TIMESTAMP,
    ZSCORE FLOAT,
    ZGRAPHMEMORYIDENTIFIER VARCHAR,
    ZSUBTITLE VARCHAR,
    ZTITLE VARCHAR,
    ZUUID VARCHAR,
    ZMOVIEASSETSTATE BLOB,
    ZASSETLISTPREDICATE BLOB,
    ZBLACKLISTEDFEATURE BLOB,
    ZMOVIEDATA BLOB,
    ZPHOTOSGRAPHDATA BLOB,
    ZSOURCEGENERATEDMEMORY INTEGER,
    ZTARGETUSEREDITEDMEMORY INTEGER,
    ZSTARTDATE TIMESTAMP,
    ZENDDATE TIMESTAMP,
    ZCREATIONTYPE INTEGER
);

CREATE TABLE ZMIGRATIONHISTORY (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCPLENABLED INTEGER,
    ZFORCEREBUILDREASON INTEGER,
    ZINDEX INTEGER,
    ZMIGRATIONTYPE INTEGER,
    ZMODELVERSION INTEGER,
    ZORIGIN INTEGER,
    ZSOURCEMODELVERSION INTEGER,
    ZINITIALSYNCDATE TIMESTAMP,
    ZMIGRATIONDATE TIMESTAMP,
    ZDEVICEUNIQUEID VARCHAR,
    ZFRAMEWORKUUID VARCHAR,
    ZHARDWAREMODEL VARCHAR,
    ZOSVERSION VARCHAR,
    ZSTOREUUID VARCHAR,
    ZGLOBALKEYVALUES BLOB
);

CREATE TABLE ZMOMENT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCACHEDCOUNT INTEGER,
    ZCACHEDCOUNTSHARED INTEGER,
    ZCACHEDPHOTOSCOUNT INTEGER,
    ZCACHEDVIDEOSCOUNT INTEGER,
    ZORIGINATORSTATE INTEGER,
    ZPROCESSEDLOCATION INTEGER,
    ZSHARINGCOMPOSITION INTEGER,
    ZTIMEZONEOFFSET INTEGER,
    ZTRASHEDSTATE INTEGER,
    ZHIGHLIGHT INTEGER,
    ZAGGREGATIONSCORE FLOAT,
    ZAPPROXIMATELATITUDE FLOAT,
    ZAPPROXIMATELONGITUDE FLOAT,
    ZENDDATE TIMESTAMP,
    ZGPSHORIZONTALACCURACY FLOAT,
    ZMODIFICATIONDATE TIMESTAMP,
    ZREPRESENTATIVEDATE TIMESTAMP,
    ZSTARTDATE TIMESTAMP,
    ZSUBTITLE VARCHAR,
    ZTITLE VARCHAR,
    ZUUID VARCHAR,
    ZLOCALIZEDLOCATIONNAMES BLOB
);

CREATE TABLE ZPERSON (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZAGETYPE INTEGER,
    ZASSETSORTORDER INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDDETECTIONTYPE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCLOUDVERIFIEDTYPE INTEGER,
    ZDETECTIONTYPE INTEGER,
    ZFACECOUNT INTEGER,
    ZGENDERTYPE INTEGER,
    ZINPERSONNAMINGMODEL INTEGER,
    ZKEYFACEPICKSOURCE INTEGER,
    ZMANUALORDER INTEGER,
    ZQUESTIONTYPE INTEGER,
    ZSUGGESTEDFORCLIENTTYPE INTEGER,
    ZTYPE INTEGER,
    ZVERIFIEDTYPE INTEGER,
    ZASSOCIATEDFACEGROUP INTEGER,
    ZKEYFACE INTEGER,
    ZMERGETARGETPERSON INTEGER,
    ZSHAREPARTICIPANT INTEGER,
    ZMERGECANDIDATECONFIDENCE FLOAT,
    ZDISPLAYNAME VARCHAR,
    ZFULLNAME VARCHAR,
    ZMDID VARCHAR,
    ZPERSONUUID VARCHAR,
    ZPERSONURI VARCHAR,
    ZCONTACTMATCHINGDICTIONARY BLOB,
    ZISMECONFIDENCE FLOAT
);

CREATE TABLE ZPERSONREFERENCE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZASSETATTRIBUTES INTEGER,
    ZPERSON INTEGER,
    ZPERSONUUID VARCHAR,
    ZPERSONDATA BLOB
);

CREATE TABLE ZPHOTOANALYSISASSETATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZWALLPAPERPROPERTIESVERSION INTEGER,
    ZASSET INTEGER,
    ZWALLPAPERPROPERTIESTIMESTAMP TIMESTAMP,
    ZWALLPAPERPROPERTIESDATA BLOB
);

CREATE TABLE ZPHOTOSHIGHLIGHT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZASSETSCOUNT INTEGER,
    ZASSETSCOUNTSHARED INTEGER,
    ZCATEGORY INTEGER,
    ZDAYGROUPASSETSCOUNT INTEGER,
    ZDAYGROUPASSETSCOUNTSHARED INTEGER,
    ZDAYGROUPEXTENDEDASSETSCOUNT INTEGER,
    ZDAYGROUPEXTENDEDASSETSCOUNTSHARED INTEGER,
    ZDAYGROUPSUMMARYASSETSCOUNT INTEGER,
    ZDAYGROUPSUMMARYASSETSCOUNTSHARED INTEGER,
    ZENDTIMEZONEOFFSET INTEGER,
    ZENRICHMENTSTATE INTEGER,
    ZENRICHMENTVERSION INTEGER,
    ZEXTENDEDCOUNT INTEGER,
    ZEXTENDEDCOUNTSHARED INTEGER,
    ZHIGHLIGHTVERSION INTEGER,
    ZKIND INTEGER,
    ZMIXEDSHARINGCOMPOSITIONKEYASSETRELATIONSHIP INTEGER,
    ZMOOD INTEGER,
    ZPHOTOASSETSSUGGESTEDBYPHOTOSCOUNT INTEGER,
    ZSEARCHINDEXREBUILDSTATE INTEGER,
    ZSHARINGCOMPOSITION INTEGER,
    ZSTARTTIMEZONEOFFSET INTEGER,
    ZSUMMARYCOUNT INTEGER,
    ZSUMMARYCOUNTSHARED INTEGER,
    ZTYPE INTEGER,
    ZVIDEOASSETSSUGGESTEDBYPHOTOSCOUNT INTEGER,
    ZVISIBILITYSTATE INTEGER,
    ZVISIBILITYSTATEMIXED INTEGER,
    ZVISIBILITYSTATESHARED INTEGER,
    ZDAYGROUPKEYASSETPRIVATE INTEGER,
    ZDAYGROUPKEYASSETSHARED INTEGER,
    ZKEYASSETPRIVATE INTEGER,
    ZKEYASSETSHARED INTEGER,
    ZMONTHKEYASSETPRIVATE INTEGER,
    ZMONTHKEYASSETSHARED INTEGER,
    ZPARENTDAYGROUPPHOTOSHIGHLIGHT INTEGER,
    ZPARENTPHOTOSHIGHLIGHT INTEGER,
    ZYEARKEYASSETPRIVATE INTEGER,
    ZYEARKEYASSETSHARED INTEGER,
    ZENDDATE TIMESTAMP,
    ZLASTENRICHMENTDATE TIMESTAMP,
    ZPROMOTIONSCORE FLOAT,
    ZSTARTDATE TIMESTAMP,
    ZSUBTITLE VARCHAR,
    ZSUBTITLEMIXED VARCHAR,
    ZSUBTITLESHARED VARCHAR,
    ZTITLE VARCHAR,
    ZTITLEMIXED VARCHAR,
    ZTITLESHARED VARCHAR,
    ZUUID VARCHAR,
    ZVERBOSESMARTDESCRIPTION VARCHAR,
    ZVERBOSESMARTDESCRIPTIONMIXED VARCHAR,
    ZVERBOSESMARTDESCRIPTIONSHARED VARCHAR
);

CREATE TABLE ZQUESTION (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZDISPLAYTYPE INTEGER,
    ZENTITYTYPE INTEGER,
    ZQUESTIONVERSION INTEGER,
    ZSTATE INTEGER,
    ZTYPE INTEGER,
    ZCREATIONDATE TIMESTAMP,
    ZSCORE FLOAT,
    ZENTITYIDENTIFIER VARCHAR,
    ZUUID VARCHAR,
    ZADDITIONALINFO BLOB
);

CREATE TABLE ZSCENECLASSIFICATION (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLASSIFICATIONTYPE INTEGER,
    ZPACKEDBOUNDINGBOXRECT INTEGER,
    ZSCENEIDENTIFIER INTEGER,
    ZASSETATTRIBUTES INTEGER,
    ZASSETATTRIBUTESFORTEMPORALSCENECLASSIFICATIONS INTEGER,
    ZCONFIDENCE FLOAT,
    ZDURATION FLOAT,
    ZSTARTTIME FLOAT
);

CREATE TABLE ZSCENEPRINT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZADDITIONALASSETATTRIBUTES INTEGER,
    ZDATA BLOB,
    ZDUPLICATEMATCHINGALTERNATEDATA BLOB,
    ZDUPLICATEMATCHINGDATA BLOB
);

CREATE TABLE ZSHARE (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZLOCALPUBLISHSTATE INTEGER,
    ZPUBLICPERMISSION INTEGER,
    ZSCOPETYPE INTEGER,
    ZSTATUS INTEGER,
    ZTRASHEDSTATE INTEGER,
    ZAUTOSHAREPOLICY INTEGER,
    ZCLOUDITEMCOUNT INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCLOUDPHOTOCOUNT INTEGER,
    ZCLOUDVIDEOCOUNT INTEGER,
    ZCOUNTOFASSETSADDEDBYCAMERASMARTSHARING INTEGER,
    ZEXITSOURCE INTEGER,
    ZEXITSTATE INTEGER,
    ZEXITTYPE INTEGER,
    ZPARTICIPANTCLOUDUPDATESTATE INTEGER,
    ZPREVIEWSTATE INTEGER,
    ZSCOPESYNCINGSTATE INTEGER,
    ZASSETCOUNT INTEGER,
    ZFORCESYNCATTEMPTED INTEGER,
    ZPHOTOSCOUNT INTEGER,
    ZSHOULDIGNOREBUDGETS INTEGER,
    ZSHOULDNOTIFYONUPLOADCOMPLETION INTEGER,
    ZUPLOADEDPHOTOSCOUNT INTEGER,
    ZUPLOADEDVIDEOSCOUNT INTEGER,
    ZVIDEOSCOUNT INTEGER,
    ZCREATIONDATE TIMESTAMP,
    ZEXPIRYDATE TIMESTAMP,
    ZTRASHEDDATE TIMESTAMP,
    ZLASTPARTICIPANTASSETTRASHNOTIFICATIONDATE TIMESTAMP,
    ZLASTPARTICIPANTASSETTRASHNOTIFICATIONVIEWEDDATE TIMESTAMP,
    ZENDDATE TIMESTAMP,
    ZSTARTDATE TIMESTAMP,
    ZSCOPEIDENTIFIER VARCHAR,
    ZTITLE VARCHAR,
    ZUUID VARCHAR,
    ZORIGINATINGSCOPEIDENTIFIER VARCHAR,
    ZSHAREURL VARCHAR,
    ZRULESDATA BLOB,
    ZPREVIEWDATA BLOB,
    ZTHUMBNAILIMAGEDATA BLOB
);

CREATE TABLE ZSHAREPARTICIPANT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZACCEPTANCESTATUS INTEGER,
    ZEXITSTATE INTEGER,
    ZISCURRENTUSER INTEGER,
    ZPERMISSION INTEGER,
    ZROLE INTEGER,
    ZPERSON INTEGER,
    ZSHARE INTEGER,
    Z62_SHARE INTEGER,
    ZEMAILADDRESS VARCHAR,
    ZPARTICIPANTID VARCHAR,
    ZPHONENUMBER VARCHAR,
    ZUSERIDENTIFIER VARCHAR,
    ZUUID VARCHAR,
    ZNAMECOMPONENTS BLOB
);

CREATE TABLE ZSUGGESTION (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZAVAILABLEFEATURES INTEGER,
    ZCACHEDCOUNT INTEGER,
    ZCACHEDPHOTOSCOUNT INTEGER,
    ZCACHEDVIDEOSCOUNT INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZFEATUREDSTATE INTEGER,
    ZNOTIFICATIONSTATE INTEGER,
    ZSHARINGCOMPOSITION INTEGER,
    ZSTATE INTEGER,
    ZSUBTYPE INTEGER,
    ZTYPE INTEGER,
    ZVERSION INTEGER,
    ZACTIVATIONDATE TIMESTAMP,
    ZCREATIONDATE TIMESTAMP,
    ZENDDATE TIMESTAMP,
    ZEXPUNGEDATE TIMESTAMP,
    ZRELEVANTUNTILDATE TIMESTAMP,
    ZSTARTDATE TIMESTAMP,
    ZSUBTITLE VARCHAR,
    ZSUGGESTIONCONTEXT VARCHAR,
    ZTITLE VARCHAR,
    ZUUID VARCHAR,
    ZACTIONDATA BLOB,
    ZFEATURESDATA BLOB,
    ZRELATEDCOLLECTIONUUID VARCHAR,
    ZRESTORETYPE INTEGER
);

CREATE TABLE ZUNMANAGEDADJUSTMENT (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZADJUSTMENTBASEIMAGEFORMAT INTEGER,
    ZADJUSTMENTRENDERTYPES INTEGER,
    ZASSETATTRIBUTES INTEGER,
    ZADJUSTMENTTIMESTAMP TIMESTAMP,
    ZADJUSTMENTFORMATIDENTIFIER VARCHAR,
    ZADJUSTMENTFORMATVERSION VARCHAR,
    ZEDITORLOCALIZEDNAME VARCHAR,
    ZOTHERADJUSTMENTSFINGERPRINT VARCHAR,
    ZSIMILARTOORIGINALADJUSTMENTSFINGERPRINT VARCHAR,
    ZUUID VARCHAR
);

CREATE TABLE ZUSERFEEDBACK (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZCLOUDDELETESTATE INTEGER,
    ZCLOUDLOCALSTATE INTEGER,
    ZCREATIONTYPE INTEGER,
    ZFEATURE INTEGER,
    ZTYPE INTEGER,
    ZMEMORY INTEGER,
    ZPERSON INTEGER,
    ZLASTMODIFIEDDATE TIMESTAMP,
    ZCONTEXT VARCHAR,
    ZUUID VARCHAR
);

CREATE TABLE ZVISUALSEARCHATTRIBUTES (
    Z_PK INTEGER PRIMARY KEY,
    Z_ENT INTEGER,
    Z_OPT INTEGER,
    ZALGORITHMVERSION INTEGER,
    ZSTICKERCONFIDENCEALGORITHMVERSION INTEGER,
    ZMEDIAANALYSISASSETATTRIBUTES INTEGER,
    ZADJUSTMENTVERSION TIMESTAMP,
    ZSTICKERCONFIDENCESCORE FLOAT,
    ZVISUALSEARCHDATA BLOB
);

CREATE TABLE Z_1KEYWORDS (
    Z_1ASSETATTRIBUTES INTEGER,
    Z_48KEYWORDS INTEGER,
    PRIMARY KEY (Z_1ASSETATTRIBUTES, Z_48KEYWORDS)
);

CREATE TABLE Z_30KEYASSETS (
    Z_30ALBUMSBEINGKEYASSETS INTEGER,
    Z_3KEYASSETS INTEGER,
    Z_FOK_3KEYASSETS INTEGER,
    PRIMARY KEY (Z_30ALBUMSBEINGKEYASSETS, Z_3KEYASSETS)
);

CREATE TABLE Z_3MEMORIESBEINGCURATEDASSETS (
    Z_3CURATEDASSETS INTEGER,
    Z_52MEMORIESBEINGCURATEDASSETS INTEGER,
    PRIMARY KEY (Z_3CURATEDASSETS, Z_52MEMORIESBEINGCURATEDASSETS)
);

CREATE TABLE Z_3MEMORIESBEINGCUSTOMUSERASSETS (
    Z_3CUSTOMUSERASSETS INTEGER,
    Z_52MEMORIESBEINGCUSTOMUSERASSETS INTEGER,
    Z_FOK_3CUSTOMUSERASSETS INTEGER,
    PRIMARY KEY (
        Z_3CUSTOMUSERASSETS,
        Z_52MEMORIESBEINGCUSTOMUSERASSETS
    )
);

CREATE TABLE Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS (
    Z_3EXTENDEDCURATEDASSETS INTEGER,
    Z_52MEMORIESBEINGEXTENDEDCURATEDASSETS INTEGER,
    PRIMARY KEY (
        Z_3EXTENDEDCURATEDASSETS,
        Z_52MEMORIESBEINGEXTENDEDCURATEDASSETS
    )
);

CREATE TABLE Z_3MEMORIESBEINGMOVIECURATEDASSETS (
    Z_3MOVIECURATEDASSETS INTEGER,
    Z_52MEMORIESBEINGMOVIECURATEDASSETS INTEGER,
    PRIMARY KEY (
        Z_3MOVIECURATEDASSETS,
        Z_52MEMORIESBEINGMOVIECURATEDASSETS
    )
);

CREATE TABLE Z_3MEMORIESBEINGREPRESENTATIVEASSETS (
    Z_3REPRESENTATIVEASSETS1 INTEGER,
    Z_52MEMORIESBEINGREPRESENTATIVEASSETS INTEGER,
    PRIMARY KEY (
        Z_3REPRESENTATIVEASSETS1,
        Z_52MEMORIESBEINGREPRESENTATIVEASSETS
    )
);

CREATE TABLE Z_3MEMORIESBEINGUSERCURATEDASSETS (
    Z_3USERCURATEDASSETS INTEGER,
    Z_52MEMORIESBEINGUSERCURATEDASSETS INTEGER,
    PRIMARY KEY (
        Z_3USERCURATEDASSETS,
        Z_52MEMORIESBEINGUSERCURATEDASSETS
    )
);

CREATE TABLE Z_3MEMORIESBEINGUSERREMOVEDASSETS (
    Z_3USERREMOVEDASSETS INTEGER,
    Z_52MEMORIESBEINGUSERREMOVEDASSETS INTEGER,
    PRIMARY KEY (
        Z_3USERREMOVEDASSETS,
        Z_52MEMORIESBEINGUSERREMOVEDASSETS
    )
);

CREATE TABLE Z_3SUGGESTIONSBEINGKEYASSETS (
    Z_3KEYASSETS1 INTEGER,
    Z_66SUGGESTIONSBEINGKEYASSETS INTEGER,
    PRIMARY KEY (Z_3KEYASSETS1, Z_66SUGGESTIONSBEINGKEYASSETS)
);

CREATE TABLE Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS (
    Z_3REPRESENTATIVEASSETS INTEGER,
    Z_66SUGGESTIONSBEINGREPRESENTATIVEASSETS INTEGER,
    PRIMARY KEY (
        Z_3REPRESENTATIVEASSETS,
        Z_66SUGGESTIONSBEINGREPRESENTATIVEASSETS
    )
);

CREATE TABLE Z_42LABELS (
    Z_42EDGES INTEGER,
    Z_44LABELS INTEGER,
    PRIMARY KEY (Z_42EDGES, Z_44LABELS)
);

CREATE TABLE Z_44NODESBEINGADDITIONALLABEL (
    Z_44ADDITIONALLABELS INTEGER,
    Z_45NODESBEINGADDITIONALLABEL INTEGER,
    PRIMARY KEY (
        Z_44ADDITIONALLABELS,
        Z_45NODESBEINGADDITIONALLABEL
    )
);

CREATE TABLE Z_METADATA (
    Z_VERSION INTEGER PRIMARY KEY,
    Z_UUID VARCHAR(255),
    Z_PLIST BLOB
);

CREATE TABLE Z_MODELCACHE (Z_CONTENT BLOB);

CREATE TABLE Z_PRIMARYKEY (
    Z_ENT INTEGER PRIMARY KEY,
    Z_NAME VARCHAR,
    Z_SUPER INTEGER,
    Z_MAX INTEGER
);

CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_DELETE_DECREMENT
AFTER
    DELETE ON ZASSET FOR EACH ROW
    WHEN OLD.ZTRASHEDSTATE == 0
    AND OLD.ZVISIBILITYSTATE == 0
    AND OLD.ZHIDDEN == 0 BEGIN
UPDATE
    ZDETECTEDFACE
SET
    ZASSETVISIBLE = MAX(0, IFNULL(ZASSETVISIBLE, 0) - 1)
WHERE
    OLD.Z_PK = ZASSETFORFACE;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue(
        'ZDETECTEDFACE',
        Z_ENT,
        Z_PK,
        'ZASSETVISIBLE',
        ZASSETVISIBLE
    )
FROM
    ZDETECTEDFACE
WHERE
    ZASSETFORFACE = OLD.Z_PK;

END;

CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_INSERT_INCREMENT
AFTER
INSERT
    ON ZASSET FOR EACH ROW
    WHEN NEW.ZTRASHEDSTATE == 0
    AND NEW.ZVISIBILITYSTATE == 0
    AND NEW.ZHIDDEN == 0 BEGIN
UPDATE
    ZDETECTEDFACE
SET
    ZASSETVISIBLE = IFNULL(ZASSETVISIBLE, 0) + 1
WHERE
    NEW.Z_PK = ZASSETFORFACE;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue(
        'ZDETECTEDFACE',
        Z_ENT,
        Z_PK,
        'ZASSETVISIBLE',
        ZASSETVISIBLE
    )
FROM
    ZDETECTEDFACE
WHERE
    ZASSETFORFACE = NEW.Z_PK;

END;

CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_UPDATE_DECREMENT
AFTER
UPDATE
    OF ZTRASHEDSTATE,
    ZVISIBILITYSTATE,
    ZHIDDEN ON ZASSET FOR EACH ROW
    WHEN (
        OLD.ZTRASHEDSTATE == 0
        AND OLD.ZVISIBILITYSTATE == 0
        AND OLD.ZHIDDEN == 0
    )
    AND (
        NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
        OR NEW.ZVISIBILITYSTATE != OLD.ZVISIBILITYSTATE
        OR NEW.ZHIDDEN != OLD.ZHIDDEN
    ) BEGIN
UPDATE
    ZDETECTEDFACE
SET
    ZASSETVISIBLE = MAX(0, IFNULL(ZASSETVISIBLE, 0) - 1)
WHERE
    OLD.Z_PK = ZASSETFORFACE;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue(
        'ZDETECTEDFACE',
        Z_ENT,
        Z_PK,
        'ZASSETVISIBLE',
        ZASSETVISIBLE
    )
FROM
    ZDETECTEDFACE
WHERE
    ZASSETFORFACE = NEW.Z_PK;

END;

CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE
    OF ZTRASHEDSTATE,
    ZVISIBILITYSTATE,
    ZHIDDEN ON ZASSET FOR EACH ROW
    WHEN (
        NEW.ZTRASHEDSTATE == 0
        AND NEW.ZVISIBILITYSTATE == 0
        AND NEW.ZHIDDEN == 0
    )
    AND (
        NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
        OR NEW.ZVISIBILITYSTATE != OLD.ZVISIBILITYSTATE
        OR NEW.ZHIDDEN != OLD.ZHIDDEN
    ) BEGIN
UPDATE
    ZDETECTEDFACE
SET
    ZASSETVISIBLE = IFNULL(ZASSETVISIBLE, 0) + 1
WHERE
    NEW.Z_PK = ZASSETFORFACE;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue(
        'ZDETECTEDFACE',
        Z_ENT,
        Z_PK,
        'ZASSETVISIBLE',
        ZASSETVISIBLE
    )
FROM
    ZDETECTEDFACE
WHERE
    ZASSETFORFACE = NEW.Z_PK;

END;

CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_ZASSETFORFACE_UPDATE_INCREMENT
AFTER
UPDATE
    OF ZASSETFORFACE ON ZDETECTEDFACE
    WHEN (
        (
            NEW.ZASSETFORFACE IS NOT NULL
            AND OLD.ZASSETFORFACE IS NULL
        )
        OR (NEW.ZASSETFORFACE != OLD.ZASSETFORFACE)
    ) BEGIN
UPDATE
    ZDETECTEDFACE
SET
    ZASSETVISIBLE = (
        SELECT
            COUNT(Z_PK)
        FROM
            ZASSET
        WHERE
            Z_PK = NEW.ZASSETFORFACE
            AND (
                ZTRASHEDSTATE == 0
                AND ZVISIBILITYSTATE == 0
                AND ZHIDDEN == 0
            )
    )
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue(
        'ZDETECTEDFACE',
        Z_ENT,
        Z_PK,
        'ZASSETVISIBLE',
        ZASSETVISIBLE
    )
FROM
    ZDETECTEDFACE
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_ZASSETFORFACE_UPDATE_TO_NULL
AFTER
UPDATE
    OF ZASSETFORFACE ON ZDETECTEDFACE
    WHEN (
        NEW.ZASSETFORFACE IS NULL
        AND OLD.ZASSETFORFACE IS NOT NULL
    ) BEGIN
UPDATE
    ZDETECTEDFACE
SET
    ZASSETVISIBLE = 0
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue(
        'ZDETECTEDFACE',
        Z_ENT,
        Z_PK,
        'ZASSETVISIBLE',
        ZASSETVISIBLE
    )
FROM
    ZDETECTEDFACE
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_ZDETECTEDFACE_INSERT_INCREMENT
AFTER
INSERT
    ON ZDETECTEDFACE FOR EACH ROW BEGIN
UPDATE
    ZDETECTEDFACE
SET
    ZASSETVISIBLE = (
        SELECT
            COUNT(Z_PK)
        FROM
            ZASSET
        WHERE
            (Z_PK = NEW.ZASSETFORFACE)
            AND (
                ZTRASHEDSTATE == 0
                AND ZVISIBILITYSTATE == 0
                AND ZHIDDEN == 0
            )
    )
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue(
        'ZDETECTEDFACE',
        Z_ENT,
        Z_PK,
        'ZASSETVISIBLE',
        ZASSETVISIBLE
    )
FROM
    ZDETECTEDFACE
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_DELETE_DECREMENT
AFTER
    DELETE ON ZDETECTEDFACE FOR EACH ROW
    WHEN OLD.ZHIDDEN == 0
    AND OLD.ZASSETVISIBLE == 1
    AND OLD.ZCENTERX != 0 BEGIN
UPDATE
    ZPERSON
SET
    ZFACECOUNT = MAX(0, IFNULL(ZFACECOUNT, 0) - 1)
WHERE
    OLD.ZPERSONFORFACE = Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM
    ZPERSON
WHERE
    Z_PK = OLD.ZPERSONFORFACE;

END;

CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_INSERT_INCREMENT
AFTER
INSERT
    ON ZDETECTEDFACE FOR EACH ROW
    WHEN NEW.ZHIDDEN == 0
    AND NEW.ZASSETVISIBLE == 1
    AND NEW.ZCENTERX != 0 BEGIN
UPDATE
    ZPERSON
SET
    ZFACECOUNT = IFNULL(ZFACECOUNT, 0) + 1
WHERE
    NEW.ZPERSONFORFACE = Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM
    ZPERSON
WHERE
    Z_PK = NEW.ZPERSONFORFACE;

END;

CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_UPDATE_DECREMENT
AFTER
UPDATE
    OF ZHIDDEN,
    ZASSETVISIBLE,
    ZCENTERX ON ZDETECTEDFACE FOR EACH ROW
    WHEN (
        OLD.ZHIDDEN == 0
        AND OLD.ZASSETVISIBLE == 1
        AND OLD.ZCENTERX != 0
    )
    AND (
        NEW.ZHIDDEN != OLD.ZHIDDEN
        OR NEW.ZASSETVISIBLE != OLD.ZASSETVISIBLE
        OR NEW.ZCENTERX != OLD.ZCENTERX
    )
    AND (OLD.ZPERSONFORFACE == NEW.ZPERSONFORFACE) BEGIN
UPDATE
    ZPERSON
SET
    ZFACECOUNT = MAX(0, IFNULL(ZFACECOUNT, 0) - 1)
WHERE
    OLD.ZPERSONFORFACE = Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM
    ZPERSON
WHERE
    Z_PK = NEW.ZPERSONFORFACE;

END;

CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_UPDATE_INCREMENT
AFTER
UPDATE
    OF ZHIDDEN,
    ZASSETVISIBLE,
    ZCENTERX ON ZDETECTEDFACE FOR EACH ROW
    WHEN (
        NEW.ZHIDDEN == 0
        AND NEW.ZASSETVISIBLE == 1
        AND NEW.ZCENTERX != 0
    )
    AND (
        NEW.ZHIDDEN != OLD.ZHIDDEN
        OR NEW.ZASSETVISIBLE != OLD.ZASSETVISIBLE
        OR NEW.ZCENTERX != OLD.ZCENTERX
    )
    AND (NEW.ZPERSONFORFACE == OLD.ZPERSONFORFACE) BEGIN
UPDATE
    ZPERSON
SET
    ZFACECOUNT = IFNULL(ZFACECOUNT, 0) + 1
WHERE
    NEW.ZPERSONFORFACE = Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM
    ZPERSON
WHERE
    Z_PK = NEW.ZPERSONFORFACE;

END;

CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_ZPERSONFORFACE_UPDATE_DECREMENT
AFTER
UPDATE
    OF ZPERSONFORFACE ON ZDETECTEDFACE
    WHEN (
        OLD.ZHIDDEN == 0
        AND OLD.ZASSETVISIBLE == 1
        AND OLD.ZCENTERX != 0
    )
    AND (
        (
            OLD.ZPERSONFORFACE IS NOT NULL
            AND NEW.ZPERSONFORFACE IS NULL
        )
        OR (NEW.ZPERSONFORFACE != OLD.ZPERSONFORFACE)
    ) BEGIN
UPDATE
    ZPERSON
SET
    ZFACECOUNT = MAX(0, IFNULL(ZFACECOUNT, 0) - 1)
WHERE
    Z_PK = OLD.ZPERSONFORFACE;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM
    ZPERSON
WHERE
    Z_PK = OLD.ZPERSONFORFACE;

END;

CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_ZPERSONFORFACE_UPDATE_INCREMENT
AFTER
UPDATE
    OF ZPERSONFORFACE ON ZDETECTEDFACE
    WHEN (
        NEW.ZHIDDEN == 0
        AND NEW.ZASSETVISIBLE == 1
        AND NEW.ZCENTERX != 0
    )
    AND (
        (
            NEW.ZPERSONFORFACE IS NOT NULL
            AND OLD.ZPERSONFORFACE IS NULL
        )
        OR (NEW.ZPERSONFORFACE != OLD.ZPERSONFORFACE)
    ) BEGIN
UPDATE
    ZPERSON
SET
    ZFACECOUNT = IFNULL(ZFACECOUNT, 0) + 1
WHERE
    Z_PK = NEW.ZPERSONFORFACE;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM
    ZPERSON
WHERE
    Z_PK = NEW.ZPERSONFORFACE;

END;

CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_ZPERSON_INSERT_INCREMENT
AFTER
INSERT
    ON ZPERSON FOR EACH ROW BEGIN
UPDATE
    ZPERSON
SET
    ZFACECOUNT = (
        SELECT
            COUNT(Z_PK)
        FROM
            ZDETECTEDFACE
        WHERE
            (ZPERSONFORFACE = NEW.Z_PK)
            AND (
                ZHIDDEN == 0
                AND ZASSETVISIBLE == 1
                AND ZCENTERX != 0
            )
    )
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM
    ZPERSON
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZADDITIONALASSETATTRIBUTES_Asset_derivedCameraCaptureDevice_PARAMETER_INSERT
AFTER
INSERT
    ON ZADDITIONALASSETATTRIBUTES FOR EACH ROW BEGIN
UPDATE
    ZASSET
SET
    ZDERIVEDCAMERACAPTUREDEVICE = NEW.ZCAMERACAPTUREDEVICE
WHERE
    ZADDITIONALATTRIBUTES = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerInsertUpdatedAffectedObjectValue(
        'ZASSET',
        Z_ENT,
        Z_PK,
        'derivedCameraCaptureDevice',
        ZDERIVEDCAMERACAPTUREDEVICE
    )
FROM
    ZASSET
WHERE
    ZADDITIONALATTRIBUTES = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZADDITIONALASSETATTRIBUTES_Asset_derivedCameraCaptureDevice_PARAMETER_UPDATE
AFTER
UPDATE
    OF ZCAMERACAPTUREDEVICE ON ZADDITIONALASSETATTRIBUTES FOR EACH ROW BEGIN
UPDATE
    ZASSET
SET
    ZDERIVEDCAMERACAPTUREDEVICE = NEW.ZCAMERACAPTUREDEVICE
WHERE
    ZADDITIONALATTRIBUTES = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerUpdatedAffectedObjectValue(
        'ZASSET',
        Z_ENT,
        Z_PK,
        'derivedCameraCaptureDevice',
        ZDERIVEDCAMERACAPTUREDEVICE
    )
FROM
    ZASSET
WHERE
    ZADDITIONALATTRIBUTES = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZASSET_Asset_derivedCameraCaptureDevice_SOURCE_INSERT
AFTER
INSERT
    ON ZASSET FOR EACH ROW BEGIN
UPDATE
    ZASSET
SET
    ZDERIVEDCAMERACAPTUREDEVICE = (
        SELECT
            ZCAMERACAPTUREDEVICE
        FROM
            ZADDITIONALASSETATTRIBUTES
        WHERE
            Z_PK = NEW.ZADDITIONALATTRIBUTES
    )
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerInsertUpdatedAffectedObjectValue(
        'ZASSET',
        Z_ENT,
        Z_PK,
        'derivedCameraCaptureDevice',
        ZDERIVEDCAMERACAPTUREDEVICE
    )
FROM
    ZASSET
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZASSET_Asset_derivedCameraCaptureDevice_SOURCE_UPDATE
AFTER
UPDATE
    OF ZADDITIONALATTRIBUTES ON ZASSET FOR EACH ROW BEGIN
UPDATE
    ZASSET
SET
    ZDERIVEDCAMERACAPTUREDEVICE = (
        SELECT
            ZCAMERACAPTUREDEVICE
        FROM
            ZADDITIONALASSETATTRIBUTES
        WHERE
            Z_PK = NEW.ZADDITIONALATTRIBUTES
    )
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerUpdatedAffectedObjectValue(
        'ZASSET',
        Z_ENT,
        Z_PK,
        'derivedCameraCaptureDevice',
        ZDERIVEDCAMERACAPTUREDEVICE
    )
FROM
    ZASSET
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZGRAPHLABEL_GraphNode_primaryLabelCode_PARAMETER_INSERT
AFTER
INSERT
    ON ZGRAPHLABEL FOR EACH ROW BEGIN
UPDATE
    ZGRAPHNODE
SET
    ZPRIMARYLABELCODE = NEW.ZCODE
WHERE
    ZPRIMARYLABEL = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerInsertUpdatedAffectedObjectValue(
        'ZGRAPHNODE',
        Z_ENT,
        Z_PK,
        'primaryLabelCode',
        ZPRIMARYLABELCODE
    )
FROM
    ZGRAPHNODE
WHERE
    ZPRIMARYLABEL = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZGRAPHLABEL_GraphNode_primaryLabelCode_PARAMETER_UPDATE
AFTER
UPDATE
    OF ZCODE ON ZGRAPHLABEL FOR EACH ROW BEGIN
UPDATE
    ZGRAPHNODE
SET
    ZPRIMARYLABELCODE = NEW.ZCODE
WHERE
    ZPRIMARYLABEL = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerUpdatedAffectedObjectValue(
        'ZGRAPHNODE',
        Z_ENT,
        Z_PK,
        'primaryLabelCode',
        ZPRIMARYLABELCODE
    )
FROM
    ZGRAPHNODE
WHERE
    ZPRIMARYLABEL = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZGRAPHNODE_GraphNode_primaryLabelCode_SOURCE_INSERT
AFTER
INSERT
    ON ZGRAPHNODE FOR EACH ROW BEGIN
UPDATE
    ZGRAPHNODE
SET
    ZPRIMARYLABELCODE = (
        SELECT
            ZCODE
        FROM
            ZGRAPHLABEL
        WHERE
            Z_PK = NEW.ZPRIMARYLABEL
    )
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerInsertUpdatedAffectedObjectValue(
        'ZGRAPHNODE',
        Z_ENT,
        Z_PK,
        'primaryLabelCode',
        ZPRIMARYLABELCODE
    )
FROM
    ZGRAPHNODE
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE TRIGGER Z_DA_ZGRAPHNODE_GraphNode_primaryLabelCode_SOURCE_UPDATE
AFTER
UPDATE
    OF ZPRIMARYLABEL ON ZGRAPHNODE FOR EACH ROW BEGIN
UPDATE
    ZGRAPHNODE
SET
    ZPRIMARYLABELCODE = (
        SELECT
            ZCODE
        FROM
            ZGRAPHLABEL
        WHERE
            Z_PK = NEW.ZPRIMARYLABEL
    )
WHERE
    Z_PK = NEW.Z_PK;

SELECT
    NSCoreDataDATriggerUpdatedAffectedObjectValue(
        'ZGRAPHNODE',
        Z_ENT,
        Z_PK,
        'primaryLabelCode',
        ZPRIMARYLABELCODE
    )
FROM
    ZGRAPHNODE
WHERE
    Z_PK = NEW.Z_PK;

END;

CREATE UNIQUE INDEX Z_GlobalKeyValue_UNIQUE_key ON ZGLOBALKEYVALUE (ZKEY COLLATE BINARY ASC);

CREATE UNIQUE INDEX Z_GraphEdgeValue_UNIQUE_edge_valueName ON ZGRAPHEDGEVALUE (
    ZEDGE COLLATE BINARY ASC,
    ZVALUENAME COLLATE BINARY ASC
);

CREATE UNIQUE INDEX Z_GraphLabel_UNIQUE_code ON ZGRAPHLABEL (ZCODE COLLATE BINARY ASC);

CREATE UNIQUE INDEX Z_GraphNodeValue_UNIQUE_node_valueName ON ZGRAPHNODEVALUE (
    ZNODE COLLATE BINARY ASC,
    ZVALUENAME COLLATE BINARY ASC
);

CREATE UNIQUE INDEX Z_InternalResource_UNIQUE_asset_resourceType_version_recipeID_compactUTI ON ZINTERNALRESOURCE (
    ZASSET COLLATE BINARY ASC,
    ZRESOURCETYPE COLLATE BINARY ASC,
    ZVERSION COLLATE BINARY ASC,
    ZRECIPEID COLLATE BINARY ASC,
    ZCOMPACTUTI COLLATE BINARY ASC
);

CREATE UNIQUE INDEX Z_Keyword_UNIQUE_title ON ZKEYWORD (ZTITLE COLLATE BINARY ASC);

CREATE UNIQUE INDEX Z_LimitedLibraryFetchFilter_UNIQUE_applicationIdentifier ON ZLIMITEDLIBRARYFETCHFILTER (ZAPPLICATIONIDENTIFIER COLLATE BINARY ASC);

CREATE UNIQUE INDEX Z_MigrationHistory_UNIQUE_index ON ZMIGRATIONHISTORY (ZINDEX COLLATE BINARY ASC);

CREATE UNIQUE INDEX Z_Share_UNIQUE_scopeIdentifier ON ZSHARE (ZSCOPEIDENTIFIER COLLATE BINARY ASC);

CREATE UNIQUE INDEX Z_TRANSACTIONSTRING_UNIQUE_NAME ON ATRANSACTIONSTRING (ZNAME COLLATE BINARY ASC);

CREATE VIRTUAL TABLE Z_RT_Asset_boundedByRect USING RTREE (
    Z_PK INTEGER PRIMARY KEY,
    ZLATITUDE_MIN FLOAT,
    ZLATITUDE_MAX FLOAT,
    ZLONGITUDE_MIN FLOAT,
    ZLONGITUDE_MAX FLOAT
)
Clone this wiki locally