-
Notifications
You must be signed in to change notification settings - Fork 104
Photos 7 (Monterey) Schema
Rhet Turnbull edited this page Oct 29, 2021
·
3 revisions
Monterey version 12.0.1
/* 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_27ASSETS (Z_27ALBUMS, Z_3ASSETS, Z_FOK_3ASSETS);
CREATE INDEX RADAR_22158684_INDEX ON Z_27ASSETS (Z_27ALBUMS, 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 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_ZCONVERSATION_INDEX ON ZASSET (ZCONVERSATION);
CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGASSETS_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGASSETS);
CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS);
CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGKEYASSET_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGKEYASSET);
CREATE INDEX ZASSET_ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS_INDEX ON ZASSET (ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS);
CREATE INDEX ZASSET_ZEXTENDEDATTRIBUTES_INDEX ON ZASSET (ZEXTENDEDATTRIBUTES);
CREATE INDEX ZASSET_ZHIGHLIGHTBEINGASSETS_INDEX ON ZASSET (ZHIGHLIGHTBEINGASSETS);
CREATE INDEX ZASSET_ZHIGHLIGHTBEINGEXTENDEDASSETS_INDEX ON ZASSET (ZHIGHLIGHTBEINGEXTENDEDASSETS);
CREATE INDEX ZASSET_ZHIGHLIGHTBEINGKEYASSET_INDEX ON ZASSET (ZHIGHLIGHTBEINGKEYASSET);
CREATE INDEX ZASSET_ZHIGHLIGHTBEINGSUMMARYASSETS_INDEX ON ZASSET (ZHIGHLIGHTBEINGSUMMARYASSETS);
CREATE INDEX ZASSET_ZIMPORTSESSION_INDEX ON ZASSET (ZIMPORTSESSION);
CREATE INDEX ZASSET_ZLIBRARYSCOPEORIGINATOR_INDEX ON ZASSET (ZLIBRARYSCOPEORIGINATOR);
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_ZMONTHHIGHLIGHTBEINGFIRSTASSET_INDEX ON ZASSET (ZMONTHHIGHLIGHTBEINGFIRSTASSET);
CREATE INDEX ZASSET_ZMONTHHIGHLIGHTBEINGKEYASSET_INDEX ON ZASSET (ZMONTHHIGHLIGHTBEINGKEYASSET);
CREATE INDEX ZASSET_ZYEARHIGHLIGHTBEINGKEYASSET_INDEX ON ZASSET (ZYEARHIGHLIGHTBEINGKEYASSET);
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 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_ZASSET_INDEX ON ZDETECTEDFACE (ZASSET);
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_ZPERSON_INDEX ON ZDETECTEDFACE (ZPERSON);
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 ZGENERICALBUM_ZCUSTOMKEYASSET_INDEX ON ZGENERICALBUM (ZCUSTOMKEYASSET);
CREATE INDEX ZGENERICALBUM_ZKEYASSET_INDEX ON ZGENERICALBUM (ZKEYASSET);
CREATE INDEX ZGENERICALBUM_ZPARENTFOLDER_INDEX ON ZGENERICALBUM (ZPARENTFOLDER);
CREATE INDEX ZGENERICALBUM_ZSECONDARYKEYASSET_INDEX ON ZGENERICALBUM (ZSECONDARYKEYASSET);
CREATE INDEX ZGENERICALBUM_ZTERTIARYKEYASSET_INDEX ON ZGENERICALBUM (ZTERTIARYKEYASSET);
CREATE INDEX ZGENERICALBUM_Z_ENT_INDEX ON ZGENERICALBUM (Z_ENT);
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 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 ZPHOTOSHIGHLIGHT_ZDAYGROUPKEYASSET_INDEX ON ZPHOTOSHIGHLIGHT (ZDAYGROUPKEYASSET);
CREATE INDEX ZPHOTOSHIGHLIGHT_ZKEYASSET_INDEX ON ZPHOTOSHIGHLIGHT (ZKEYASSET);
CREATE INDEX ZPHOTOSHIGHLIGHT_ZMONTHFIRSTASSET_INDEX ON ZPHOTOSHIGHLIGHT (ZMONTHFIRSTASSET);
CREATE INDEX ZPHOTOSHIGHLIGHT_ZMONTHKEYASSET_INDEX ON ZPHOTOSHIGHLIGHT (ZMONTHKEYASSET);
CREATE INDEX ZPHOTOSHIGHLIGHT_ZPARENTDAYGROUPPHOTOSHIGHLIGHT_INDEX ON ZPHOTOSHIGHLIGHT (ZPARENTDAYGROUPPHOTOSHIGHLIGHT);
CREATE INDEX ZPHOTOSHIGHLIGHT_ZPARENTPHOTOSHIGHLIGHT_INDEX ON ZPHOTOSHIGHLIGHT (ZPARENTPHOTOSHIGHLIGHT);
CREATE INDEX ZPHOTOSHIGHLIGHT_ZYEARKEYASSET_INDEX ON ZPHOTOSHIGHLIGHT (ZYEARKEYASSET);
CREATE INDEX ZSCENECLASSIFICATION_ZASSETATTRIBUTES_INDEX ON ZSCENECLASSIFICATION (ZASSETATTRIBUTES);
CREATE INDEX ZSCENEPRINT_ZADDITIONALASSETATTRIBUTES_INDEX ON ZSCENEPRINT (ZADDITIONALASSETATTRIBUTES);
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_17CLUSTERREJECTEDPERSONS_Z_45CLUSTERREJECTEDPERSONS_INDEX ON Z_17CLUSTERREJECTEDPERSONS (
Z_45CLUSTERREJECTEDPERSONS,
Z_17CLUSTERREJECTEDFACES
);
CREATE INDEX Z_17REJECTEDPERSONSNEEDINGFACECROPS_Z_45REJECTEDPERSONSNEEDINGFACECROPS_INDEX ON Z_17REJECTEDPERSONSNEEDINGFACECROPS (
Z_45REJECTEDPERSONSNEEDINGFACECROPS,
Z_17REJECTEDFACESNEEDINGFACECROPS
);
CREATE INDEX Z_17REJECTEDPERSONS_Z_45REJECTEDPERSONS_INDEX ON Z_17REJECTEDPERSONS (Z_45REJECTEDPERSONS, Z_17REJECTEDFACES);
CREATE INDEX Z_1KEYWORDS_Z_38KEYWORDS_INDEX ON Z_1KEYWORDS (Z_38KEYWORDS, Z_1ASSETATTRIBUTES);
CREATE INDEX Z_26ALBUMLISTS_Z_2ALBUMLISTS_INDEX ON Z_26ALBUMLISTS (Z_2ALBUMLISTS, Z_26ALBUMS);
CREATE INDEX Z_27ASSETS_Z_3ASSETS_INDEX ON Z_27ASSETS (Z_3ASSETS, Z_27ALBUMS);
CREATE INDEX Z_3MEMORIESBEINGCURATEDASSETS_Z_42MEMORIESBEINGCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGCURATEDASSETS (Z_42MEMORIESBEINGCURATEDASSETS, Z_3CURATEDASSETS);
CREATE INDEX Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS_Z_42MEMORIESBEINGEXTENDEDCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS (
Z_42MEMORIESBEINGEXTENDEDCURATEDASSETS,
Z_3EXTENDEDCURATEDASSETS
);
CREATE INDEX Z_3MEMORIESBEINGMOVIECURATEDASSETS_Z_42MEMORIESBEINGMOVIECURATEDASSETS_INDEX ON Z_3MEMORIESBEINGMOVIECURATEDASSETS (
Z_42MEMORIESBEINGMOVIECURATEDASSETS,
Z_3MOVIECURATEDASSETS
);
CREATE INDEX Z_3MEMORIESBEINGREPRESENTATIVEASSETS_Z_42MEMORIESBEINGREPRESENTATIVEASSETS_INDEX ON Z_3MEMORIESBEINGREPRESENTATIVEASSETS (
Z_42MEMORIESBEINGREPRESENTATIVEASSETS,
Z_3REPRESENTATIVEASSETS
);
CREATE INDEX Z_3MEMORIESBEINGUSERCURATEDASSETS_Z_42MEMORIESBEINGUSERCURATEDASSETS_INDEX ON Z_3MEMORIESBEINGUSERCURATEDASSETS (
Z_42MEMORIESBEINGUSERCURATEDASSETS,
Z_3USERCURATEDASSETS
);
CREATE INDEX Z_3SUGGESTIONSBEINGKEYASSETS_Z_55SUGGESTIONSBEINGKEYASSETS_INDEX ON Z_3SUGGESTIONSBEINGKEYASSETS (Z_55SUGGESTIONSBEINGKEYASSETS, Z_3KEYASSETS);
CREATE INDEX Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS_Z_55SUGGESTIONSBEINGREPRESENTATIVEASSETS_INDEX ON Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS (
Z_55SUGGESTIONSBEINGREPRESENTATIVEASSETS,
Z_3REPRESENTATIVEASSETS1
);
CREATE INDEX Z_45INVALIDMERGECANDIDATES_REFLEXIVE_INDEX ON Z_45INVALIDMERGECANDIDATES (REFLEXIVE, Z_45INVALIDMERGECANDIDATES);
CREATE INDEX Z_45MERGECANDIDATES_REFLEXIVE_INDEX ON Z_45MERGECANDIDATES (REFLEXIVE, Z_45MERGECANDIDATES);
CREATE INDEX Z_AdditionalAssetAttributes_byAdjustedFingerPrintIndex ON ZADDITIONALASSETATTRIBUTES (ZADJUSTEDFINGERPRINT 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 (ZMASTERFINGERPRINT 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_AlbumList_byIdentifierIndex ON ZALBUMLIST (ZIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_AlbumList_byUuidIndex ON ZALBUMLIST (ZUUID COLLATE BINARY ASC);
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_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_byFavoriteIndex ON ZASSET (ZFAVORITE 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_byMonthHighlightBeingFirstAsset ON ZASSET (
ZDATECREATED COLLATE BINARY ASC,
ZMONTHHIGHLIGHTBEINGFIRSTASSET COLLATE BINARY ASC
)
WHERE ZMONTHHIGHLIGHTBEINGFIRSTASSET IS NOT NULL;
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_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_compoundIndex7 ON ZASSET (
ZADDEDDATE COLLATE BINARY ASC,
ZSORTTOKEN COLLATE BINARY ASC,
ZKIND 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
);
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
);
CREATE INDEX Z_Asset_forAllPhotosDays ON ZASSET (
ZHIGHLIGHTBEINGEXTENDEDASSETS COLLATE BINARY ASC,
ZDATECREATED COLLATE BINARY ASC
)
WHERE ZHIGHLIGHTBEINGEXTENDEDASSETS IS NOT NULL;
CREATE INDEX Z_Asset_forAllPhotosFilteredWithAdjustments ON ZASSET (
ZHASADJUSTMENTS 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
)
WHERE ZHASADJUSTMENTS = 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_forPlacesAlbum ON ZASSET (
ZLATITUDE COLLATE BINARY ASC,
ZLONGITUDE COLLATE BINARY ASC,
ZTRASHEDSTATE COLLATE BINARY ASC,
ZHIDDEN COLLATE BINARY ASC,
ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
ZSAVEDASSETTYPE COLLATE BINARY ASC,
ZVISIBILITYSTATE 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_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_forThumbnailAsset ON ZASSET (
ZTHUMBNAILINDEX COLLATE BINARY ASC,
ZCOMPLETE COLLATE BINARY ASC,
ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC
);
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_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_CloudFeedEntry_byEntryDateIndex ON ZCLOUDFEEDENTRY (ZENTRYDATE COLLATE BINARY ASC);
CREATE INDEX Z_CloudFeedEntry_byEntryTypeNumberIndex ON ZCLOUDFEEDENTRY (ZENTRYTYPENUMBER 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_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_byUuidIndex ON ZDETECTEDFACE (ZUUID COLLATE BINARY ASC);
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_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_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_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_byUuidIndex ON ZMEMORY (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_Memory_compoundIndex ON ZMEMORY (
ZCREATIONDATE COLLATE BINARY DESC,
ZREJECTED 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_byCloudLocalStateIndex ON ZPERSON (ZCLOUDLOCALSTATE 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_byPersonUUIDIndex ON ZPERSON (ZPERSONUUID COLLATE BINARY ASC);
CREATE INDEX Z_Person_byPersonUriIndex ON ZPERSON (ZPERSONURI 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_PhotosHighlight_byDateRangeAndKind ON ZPHOTOSHIGHLIGHT (
ZKIND COLLATE BINARY ASC,
ZSTARTDATE COLLATE BINARY ASC,
ZENDDATE COLLATE BINARY ASC
);
CREATE INDEX Z_PhotosHighlight_byKindIndex ON ZPHOTOSHIGHLIGHT (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_PhotosHighlight_byUuidIndex ON ZPHOTOSHIGHLIGHT (ZUUID 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_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_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,
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,
ZSCENEANALYSISTIMESTAMP TIMESTAMP,
ZACCESSIBILITYDESCRIPTION VARCHAR,
ZADJUSTEDFINGERPRINT VARCHAR,
ZDEFERREDPHOTOIDENTIFIER VARCHAR,
ZEDITORBUNDLEID VARCHAR,
ZEXIFTIMESTAMPSTRING VARCHAR,
ZIMPORTSESSIONID VARCHAR,
ZIMPORTEDBYBUNDLEIDENTIFIER VARCHAR,
ZIMPORTEDBYDISPLAYNAME VARCHAR,
ZMASTERFINGERPRINT VARCHAR,
ZMEDIAMETADATATYPE VARCHAR,
ZMONTAGE VARCHAR,
ZORIGINALASSETSUUID VARCHAR,
ZORIGINALFILENAME VARCHAR,
ZORIGINATINGASSETIDENTIFIER VARCHAR,
ZPHOTOSTREAMTAGID VARCHAR,
ZPUBLICGLOBALUUID VARCHAR,
ZSHAREORIGINATOR VARCHAR,
ZSNOWDAYSNOWPLOWIDENTIFIER VARCHAR,
ZSOURCEASSETFORDUPLICATIONIDENTIFIER VARCHAR,
ZSOURCEASSETFORDUPLICATIONSCOPEIDENTIFIER VARCHAR,
ZSPATIALOVERCAPTUREGROUPIDENTIFIER VARCHAR,
ZSYNDICATIONIDENTIFIER VARCHAR,
ZTIMEZONENAME VARCHAR,
ZTITLE VARCHAR,
ZDISTANCEIDENTITY BLOB,
ZFACEREGIONS BLOB,
ZOBJECTSALIENCYRECTSDATA BLOB,
ZORIGINALHASH BLOB,
ZPLACEANNOTATIONDATA BLOB,
ZREVERSELOCATIONDATA BLOB,
ZSHIFTEDLOCATIONDATA BLOB
);
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,
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,
ZDEFERREDPROCESSINGNEEDED INTEGER,
ZDEPTHTYPE INTEGER,
ZDERIVEDCAMERACAPTUREDEVICE INTEGER,
ZFACEAREAPOINTS INTEGER,
ZFAVORITE INTEGER,
ZHASADJUSTMENTS INTEGER,
ZHDRTYPE INTEGER,
ZHEIGHT INTEGER,
ZHIDDEN INTEGER,
ZHIGHFRAMERATESTATE INTEGER,
ZISMAGICCARPET INTEGER,
ZKIND INTEGER,
ZKINDSUBTYPE INTEGER,
ZORIENTATION INTEGER,
ZPACKEDACCEPTABLECROPRECT INTEGER,
ZPACKEDBADGEATTRIBUTES INTEGER,
ZPACKEDPREFERREDCROPRECT INTEGER,
ZPLAYBACKSTYLE INTEGER,
ZPLAYBACKVARIATION INTEGER,
ZSAVEDASSETTYPE INTEGER,
ZSYNDICATIONSTATE INTEGER,
ZTHUMBNAILINDEX INTEGER,
ZTRASHEDSTATE INTEGER,
ZVIDEOCPDURATIONVALUE INTEGER,
ZVIDEOCPVISIBILITYSTATE INTEGER,
ZVIDEODEFERREDPROCESSINGNEEDED INTEGER,
ZVIDEOKEYFRAMETIMESCALE INTEGER,
ZVIDEOKEYFRAMEVALUE INTEGER,
ZVISIBILITYSTATE INTEGER,
ZWIDTH INTEGER,
ZADDITIONALATTRIBUTES INTEGER,
ZCLOUDFEEDASSETSENTRY INTEGER,
ZCOMPUTEDATTRIBUTES INTEGER,
ZCONVERSATION INTEGER,
ZDAYGROUPHIGHLIGHTBEINGASSETS INTEGER,
ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS INTEGER,
ZDAYGROUPHIGHLIGHTBEINGKEYASSET INTEGER,
ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS INTEGER,
ZEXTENDEDATTRIBUTES INTEGER,
ZHIGHLIGHTBEINGASSETS INTEGER,
ZHIGHLIGHTBEINGEXTENDEDASSETS INTEGER,
ZHIGHLIGHTBEINGKEYASSET INTEGER,
ZHIGHLIGHTBEINGSUMMARYASSETS INTEGER,
ZIMPORTSESSION INTEGER,
ZLIBRARYSCOPE INTEGER,
ZLIBRARYSCOPEORIGINATOR INTEGER,
ZMASTER INTEGER,
ZMEDIAANALYSISATTRIBUTES INTEGER,
ZMOMENT INTEGER,
ZMOMENTSHARE INTEGER,
ZMONTHHIGHLIGHTBEINGFIRSTASSET INTEGER,
ZMONTHHIGHLIGHTBEINGKEYASSET INTEGER,
ZYEARHIGHLIGHTBEINGKEYASSET INTEGER,
Z_FOK_CLOUDFEEDASSETSENTRY 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,
ZLASTSHAREDDATE TIMESTAMP,
ZLATITUDE FLOAT,
ZLONGITUDE FLOAT,
ZMODIFICATIONDATE TIMESTAMP,
ZOVERALLAESTHETICSCORE FLOAT,
ZPROMOTIONSCORE FLOAT,
ZSORTTOKEN FLOAT,
ZTRASHEDDATE TIMESTAMP,
ZAVALANCHEUUID VARCHAR,
ZCLOUDASSETGUID VARCHAR,
ZCLOUDBATCHID VARCHAR,
ZCLOUDCOLLECTIONGUID VARCHAR,
ZCLOUDOWNERHASHEDPERSONID 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 ZASSETDESCRIPTION (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZASSETATTRIBUTES INTEGER,
ZLONGDESCRIPTION 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
);
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
);
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 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,
ZASSET INTEGER,
ZFACECROP INTEGER,
ZFACEGROUP INTEGER,
ZFACEGROUPBEINGKEYFACE INTEGER,
ZFACEPRINT INTEGER,
ZPERSON INTEGER,
ZPERSONBEINGKEYFACE INTEGER,
ZADJUSTMENTVERSION TIMESTAMP,
ZBLURSCORE FLOAT,
ZBODYCENTERX FLOAT,
ZBODYCENTERY FLOAT,
ZBODYHEIGHT FLOAT,
ZBODYWIDTH FLOAT,
ZCENTERX FLOAT,
ZCENTERY FLOAT,
ZGAZECENTERX FLOAT,
ZGAZECENTERY FLOAT,
ZLEFTEYEX FLOAT,
ZLEFTEYEY FLOAT,
ZMOUTHX FLOAT,
ZMOUTHY FLOAT,
ZPOSEYAW FLOAT,
ZQUALITY FLOAT,
ZRIGHTEYEX FLOAT,
ZRIGHTEYEY FLOAT,
ZROLL FLOAT,
ZSIZE FLOAT,
ZYAW FLOAT,
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
);
CREATE TABLE ZEXTENDEDATTRIBUTES (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZFLASHFIRED INTEGER,
ZFOCALLENGTHIN35MM INTEGER,
ZISO INTEGER,
ZMETERINGMODE INTEGER,
ZSAMPLERATE INTEGER,
ZSLUSHPRESET INTEGER,
ZSLUSHVERSION INTEGER,
ZTRACKFORMAT INTEGER,
ZWHITEBALANCE INTEGER,
ZASSET INTEGER,
ZAPERTURE FLOAT,
ZBITRATE FLOAT,
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
);
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 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,
ZSYNCEVENTORDERKEY INTEGER,
ZTRASHEDSTATE INTEGER,
ZCUSTOMKEYASSET INTEGER,
ZKEYASSET INTEGER,
ZPARENTFOLDER INTEGER,
ZSECONDARYKEYASSET INTEGER,
ZTERTIARYKEYASSET 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,
ZKEYASSETFACEIDENTIFIER INTEGER,
ZKEYASSETFACETHUMBNAILINDEX INTEGER,
ZSYNDICATE 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 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,
ZORIENTATION INTEGER,
ZPTPTRASHEDSTATE INTEGER,
ZQUALITYSORTVALUE 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
);
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,
ZAUDIOCLASSIFICATION INTEGER,
ZBESTVIDEORANGEDURATIONTIMESCALE INTEGER,
ZBESTVIDEORANGEDURATIONVALUE INTEGER,
ZBESTVIDEORANGESTARTTIMESCALE INTEGER,
ZBESTVIDEORANGESTARTVALUE INTEGER,
ZFACECOUNT INTEGER,
ZMEDIAANALYSISVERSION INTEGER,
ZPACKEDBESTPLAYBACKRECT INTEGER,
ZPROBABLEROTATIONDIRECTION INTEGER,
ZSCREENTIMEDEVICEIMAGESENSITIVITY INTEGER,
ZSYNDICATIONPROCESSINGVALUE INTEGER,
ZSYNDICATIONPROCESSINGVERSION INTEGER,
ZASSET INTEGER,
ZCHARACTERRECOGNITIONATTRIBUTES INTEGER,
ZVISUALSEARCHATTRIBUTES INTEGER,
ZACTIVITYSCORE FLOAT,
ZAUTOPLAYSUGGESTIONSCORE FLOAT,
ZBLURRINESSSCORE FLOAT,
ZEXPOSURESCORE FLOAT,
ZMEDIAANALYSISTIMESTAMP TIMESTAMP,
ZPROBABLEROTATIONDIRECTIONCONFIDENCE FLOAT,
ZVIDEOSCORE FLOAT,
ZCOLORNORMALIZATIONDATA BLOB
);
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,
ZSHARECOUNT 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
);
CREATE TABLE ZMIGRATIONHISTORY (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZFORCEREBUILDREASON INTEGER,
ZINDEX INTEGER,
ZMIGRATIONTYPE INTEGER,
ZMODELVERSION INTEGER,
ZORIGIN INTEGER,
ZSOURCEMODELVERSION INTEGER,
ZMIGRATIONDATE TIMESTAMP,
ZOSVERSION VARCHAR,
ZSTOREUUID VARCHAR,
ZGLOBALKEYVALUES BLOB
);
CREATE TABLE ZMOMENT (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZCACHEDCOUNT INTEGER,
ZCACHEDPHOTOSCOUNT INTEGER,
ZCACHEDVIDEOSCOUNT INTEGER,
ZORIGINATORSTATE INTEGER,
ZPROCESSEDLOCATION 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,
ZCLOUDDELETESTATE 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,
ZDISPLAYNAME VARCHAR,
ZFULLNAME VARCHAR,
ZPERSONUUID VARCHAR,
ZPERSONURI VARCHAR,
ZCONTACTMATCHINGDICTIONARY BLOB
);
CREATE TABLE ZPERSONREFERENCE (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZASSETATTRIBUTES INTEGER,
ZPERSON INTEGER,
ZPERSONUUID VARCHAR,
ZPERSONDATA BLOB
);
CREATE TABLE ZPHOTOSHIGHLIGHT (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZASSETSCOUNT INTEGER,
ZCATEGORY INTEGER,
ZDAYGROUPASSETSCOUNT INTEGER,
ZDAYGROUPEXTENDEDASSETSCOUNT INTEGER,
ZDAYGROUPSUMMARYASSETSCOUNT INTEGER,
ZENDTIMEZONEOFFSET INTEGER,
ZENRICHMENTSTATE INTEGER,
ZENRICHMENTVERSION INTEGER,
ZEXTENDEDCOUNT INTEGER,
ZHIGHLIGHTVERSION INTEGER,
ZKIND INTEGER,
ZMOOD INTEGER,
ZSTARTTIMEZONEOFFSET INTEGER,
ZSUMMARYCOUNT INTEGER,
ZTYPE INTEGER,
ZVISIBILITYSTATE INTEGER,
ZDAYGROUPKEYASSET INTEGER,
ZKEYASSET INTEGER,
ZMONTHFIRSTASSET INTEGER,
ZMONTHKEYASSET INTEGER,
ZPARENTDAYGROUPPHOTOSHIGHLIGHT INTEGER,
ZPARENTPHOTOSHIGHLIGHT INTEGER,
ZYEARKEYASSET INTEGER,
ZENDDATE TIMESTAMP,
ZPROMOTIONSCORE FLOAT,
ZSTARTDATE TIMESTAMP,
ZSUBTITLE VARCHAR,
ZTITLE VARCHAR,
ZUUID VARCHAR,
ZVERBOSESMARTDESCRIPTION VARCHAR
);
CREATE TABLE ZQUESTION (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZDISPLAYTYPE INTEGER,
ZENTITYTYPE 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,
ZPACKEDBOUNDINGBOXRECT INTEGER,
ZSCENEIDENTIFIER INTEGER,
ZASSETATTRIBUTES INTEGER,
ZCONFIDENCE FLOAT
);
CREATE TABLE ZSCENEPRINT (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZADDITIONALASSETATTRIBUTES INTEGER,
ZDATA 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,
ZACTIVATED INTEGER,
ZAUTOSHAREPOLICY INTEGER,
ZCLOUDUPDATESTATE INTEGER,
ZASSETCOUNT INTEGER,
ZFORCESYNCATTEMPTED INTEGER,
ZPHOTOSCOUNT INTEGER,
ZSHOULDIGNOREBUDGETS INTEGER,
ZSHOULDNOTIFYONUPLOADCOMPLETION INTEGER,
ZUPLOADEDPHOTOSCOUNT INTEGER,
ZUPLOADEDVIDEOSCOUNT INTEGER,
ZVIDEOSCOUNT INTEGER,
ZCREATIONDATE TIMESTAMP,
ZEXPIRYDATE 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,
ZISCURRENTUSER INTEGER,
ZPERMISSION INTEGER,
ZROLE INTEGER,
ZSHARE INTEGER,
Z51_SHARE INTEGER,
ZEMAILADDRESS VARCHAR,
ZPHONENUMBER VARCHAR,
ZUSERIDENTIFIER VARCHAR,
ZUUID VARCHAR,
ZNAMECOMPONENTS BLOB
);
CREATE TABLE ZSUGGESTION (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZCACHEDCOUNT INTEGER,
ZCACHEDPHOTOSCOUNT INTEGER,
ZCACHEDVIDEOSCOUNT INTEGER,
ZCLOUDDELETESTATE INTEGER,
ZCLOUDLOCALSTATE INTEGER,
ZFEATUREDSTATE INTEGER,
ZNOTIFICATIONSTATE INTEGER,
ZSTATE INTEGER,
ZSUBTYPE INTEGER,
ZTYPE INTEGER,
ZVERSION INTEGER,
ZACTIVATIONDATE TIMESTAMP,
ZCREATIONDATE TIMESTAMP,
ZENDDATE TIMESTAMP,
ZEXPUNGEDATE TIMESTAMP,
ZRELEVANTUNTILDATE TIMESTAMP,
ZSTARTDATE TIMESTAMP,
ZSUBTITLE VARCHAR,
ZTITLE VARCHAR,
ZUUID VARCHAR,
ZACTIONDATA BLOB,
ZFEATURESDATA BLOB
);
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,
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,
ZMEDIAANALYSISASSETATTRIBUTES INTEGER,
ZADJUSTMENTVERSION TIMESTAMP,
ZVISUALSEARCHDATA BLOB
);
CREATE TABLE Z_17CLUSTERREJECTEDPERSONS (
Z_17CLUSTERREJECTEDFACES INTEGER,
Z_45CLUSTERREJECTEDPERSONS INTEGER,
PRIMARY KEY (
Z_17CLUSTERREJECTEDFACES,
Z_45CLUSTERREJECTEDPERSONS
)
);
CREATE TABLE Z_17REJECTEDPERSONS (
Z_17REJECTEDFACES INTEGER,
Z_45REJECTEDPERSONS INTEGER,
PRIMARY KEY (Z_17REJECTEDFACES, Z_45REJECTEDPERSONS)
);
CREATE TABLE Z_17REJECTEDPERSONSNEEDINGFACECROPS (
Z_17REJECTEDFACESNEEDINGFACECROPS INTEGER,
Z_45REJECTEDPERSONSNEEDINGFACECROPS INTEGER,
PRIMARY KEY (
Z_17REJECTEDFACESNEEDINGFACECROPS,
Z_45REJECTEDPERSONSNEEDINGFACECROPS
)
);
CREATE TABLE Z_1KEYWORDS (
Z_1ASSETATTRIBUTES INTEGER,
Z_38KEYWORDS INTEGER,
PRIMARY KEY (Z_1ASSETATTRIBUTES, Z_38KEYWORDS)
);
CREATE TABLE Z_26ALBUMLISTS (
Z_26ALBUMS INTEGER,
Z_2ALBUMLISTS INTEGER,
Z_FOK_26ALBUMS INTEGER,
PRIMARY KEY (Z_26ALBUMS, Z_2ALBUMLISTS)
);
CREATE TABLE Z_27ASSETS (
Z_27ALBUMS INTEGER,
Z_3ASSETS INTEGER,
Z_FOK_3ASSETS INTEGER,
PRIMARY KEY (Z_27ALBUMS, Z_3ASSETS)
);
CREATE TABLE Z_3MEMORIESBEINGCURATEDASSETS (
Z_3CURATEDASSETS INTEGER,
Z_42MEMORIESBEINGCURATEDASSETS INTEGER,
PRIMARY KEY (Z_3CURATEDASSETS, Z_42MEMORIESBEINGCURATEDASSETS)
);
CREATE TABLE Z_3MEMORIESBEINGEXTENDEDCURATEDASSETS (
Z_3EXTENDEDCURATEDASSETS INTEGER,
Z_42MEMORIESBEINGEXTENDEDCURATEDASSETS INTEGER,
PRIMARY KEY (
Z_3EXTENDEDCURATEDASSETS,
Z_42MEMORIESBEINGEXTENDEDCURATEDASSETS
)
);
CREATE TABLE Z_3MEMORIESBEINGMOVIECURATEDASSETS (
Z_3MOVIECURATEDASSETS INTEGER,
Z_42MEMORIESBEINGMOVIECURATEDASSETS INTEGER,
PRIMARY KEY (
Z_3MOVIECURATEDASSETS,
Z_42MEMORIESBEINGMOVIECURATEDASSETS
)
);
CREATE TABLE Z_3MEMORIESBEINGREPRESENTATIVEASSETS (
Z_3REPRESENTATIVEASSETS INTEGER,
Z_42MEMORIESBEINGREPRESENTATIVEASSETS INTEGER,
PRIMARY KEY (
Z_3REPRESENTATIVEASSETS,
Z_42MEMORIESBEINGREPRESENTATIVEASSETS
)
);
CREATE TABLE Z_3MEMORIESBEINGUSERCURATEDASSETS (
Z_3USERCURATEDASSETS INTEGER,
Z_42MEMORIESBEINGUSERCURATEDASSETS INTEGER,
PRIMARY KEY (
Z_3USERCURATEDASSETS,
Z_42MEMORIESBEINGUSERCURATEDASSETS
)
);
CREATE TABLE Z_3SUGGESTIONSBEINGKEYASSETS (
Z_3KEYASSETS INTEGER,
Z_55SUGGESTIONSBEINGKEYASSETS INTEGER,
PRIMARY KEY (Z_3KEYASSETS, Z_55SUGGESTIONSBEINGKEYASSETS)
);
CREATE TABLE Z_3SUGGESTIONSBEINGREPRESENTATIVEASSETS (
Z_3REPRESENTATIVEASSETS1 INTEGER,
Z_55SUGGESTIONSBEINGREPRESENTATIVEASSETS INTEGER,
PRIMARY KEY (
Z_3REPRESENTATIVEASSETS1,
Z_55SUGGESTIONSBEINGREPRESENTATIVEASSETS
)
);
CREATE TABLE Z_45INVALIDMERGECANDIDATES (
Z_45INVALIDMERGECANDIDATES INTEGER,
REFLEXIVE INTEGER,
PRIMARY KEY (Z_45INVALIDMERGECANDIDATES, REFLEXIVE)
);
CREATE TABLE Z_45MERGECANDIDATES (
Z_45MERGECANDIDATES INTEGER,
REFLEXIVE INTEGER,
PRIMARY KEY (Z_45MERGECANDIDATES, REFLEXIVE)
);
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 = ZASSET;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZDETECTEDFACE',
Z_ENT,
Z_PK,
'ZASSETVISIBLE',
ZASSETVISIBLE
)
FROM ZDETECTEDFACE
WHERE ZASSET = 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 = ZASSET;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZDETECTEDFACE',
Z_ENT,
Z_PK,
'ZASSETVISIBLE',
ZASSETVISIBLE
)
FROM ZDETECTEDFACE
WHERE ZASSET = 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 = ZASSET;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZDETECTEDFACE',
Z_ENT,
Z_PK,
'ZASSETVISIBLE',
ZASSETVISIBLE
)
FROM ZDETECTEDFACE
WHERE ZASSET = 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 = ZASSET;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZDETECTEDFACE',
Z_ENT,
Z_PK,
'ZASSETVISIBLE',
ZASSETVISIBLE
)
FROM ZDETECTEDFACE
WHERE ZASSET = NEW.Z_PK;
END;
CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZASSET_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE OF ZASSET ON ZDETECTEDFACE
WHEN (
(
NEW.ZASSET IS NOT NULL
AND OLD.ZASSET IS NULL
)
OR (NEW.ZASSET != OLD.ZASSET)
) BEGIN
UPDATE ZDETECTEDFACE
SET ZASSETVISIBLE = (
SELECT COUNT(Z_PK)
FROM ZASSET
WHERE Z_PK = NEW.ZASSET
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_ZASSET_UPDATE_TO_NULL
AFTER
UPDATE OF ZASSET ON ZDETECTEDFACE
WHEN (
NEW.ZASSET IS NULL
AND OLD.ZASSET 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.ZASSET)
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.ZPERSON = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM ZPERSON
WHERE Z_PK = OLD.ZPERSON;
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.ZPERSON = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM ZPERSON
WHERE Z_PK = NEW.ZPERSON;
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.ZPERSON == NEW.ZPERSON) BEGIN
UPDATE ZPERSON
SET ZFACECOUNT = MAX(0, IFNULL(ZFACECOUNT, 0) - 1)
WHERE OLD.ZPERSON = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM ZPERSON
WHERE Z_PK = NEW.ZPERSON;
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.ZPERSON == OLD.ZPERSON) BEGIN
UPDATE ZPERSON
SET ZFACECOUNT = IFNULL(ZFACECOUNT, 0) + 1
WHERE NEW.ZPERSON = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM ZPERSON
WHERE Z_PK = NEW.ZPERSON;
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 (ZPERSON = 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 ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_ZPERSON_UPDATE_DECREMENT
AFTER
UPDATE OF ZPERSON ON ZDETECTEDFACE
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZASSETVISIBLE == 1
AND OLD.ZCENTERX != 0
)
AND (
(
OLD.ZPERSON IS NOT NULL
AND NEW.ZPERSON IS NULL
)
OR (NEW.ZPERSON != OLD.ZPERSON)
) BEGIN
UPDATE ZPERSON
SET ZFACECOUNT = MAX(0, IFNULL(ZFACECOUNT, 0) - 1)
WHERE Z_PK = OLD.ZPERSON;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM ZPERSON
WHERE Z_PK = OLD.ZPERSON;
END;
CREATE TRIGGER ZT_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_ZPERSON_UPDATE_INCREMENT
AFTER
UPDATE OF ZPERSON ON ZDETECTEDFACE
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZASSETVISIBLE == 1
AND NEW.ZCENTERX != 0
)
AND (
(
NEW.ZPERSON IS NOT NULL
AND OLD.ZPERSON IS NULL
)
OR (NEW.ZPERSON != OLD.ZPERSON)
) BEGIN
UPDATE ZPERSON
SET ZFACECOUNT = IFNULL(ZFACECOUNT, 0) + 1
WHERE Z_PK = NEW.ZPERSON;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue('ZPERSON', Z_ENT, Z_PK, 'ZFACECOUNT', ZFACECOUNT)
FROM ZPERSON
WHERE Z_PK = NEW.ZPERSON;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZASSET_DELETE_DECREMENT
AFTER DELETE ON ZASSET FOR EACH ROW
WHEN OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZASSETSCOUNT = MAX(0, IFNULL(ZASSETSCOUNT, 0) - 1)
WHERE OLD.ZHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZASSETSCOUNT',
ZASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZASSET_INSERT_INCREMENT
AFTER
INSERT ON ZASSET FOR EACH ROW
WHEN NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZASSETSCOUNT = IFNULL(ZASSETSCOUNT, 0) + 1
WHERE NEW.ZHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZASSETSCOUNT',
ZASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZASSET_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
OLD.ZHIGHLIGHTBEINGASSETS == NEW.ZHIGHLIGHTBEINGASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZASSETSCOUNT = MAX(0, IFNULL(ZASSETSCOUNT, 0) - 1)
WHERE OLD.ZHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZASSETSCOUNT',
ZASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
NEW.ZHIGHLIGHTBEINGASSETS == OLD.ZHIGHLIGHTBEINGASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZASSETSCOUNT = IFNULL(ZASSETSCOUNT, 0) + 1
WHERE NEW.ZHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZASSETSCOUNT',
ZASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZASSET_ZHIGHLIGHTBEINGASSETS_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIGHLIGHTBEINGASSETS ON ZASSET
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
(
OLD.ZHIGHLIGHTBEINGASSETS IS NOT NULL
AND NEW.ZHIGHLIGHTBEINGASSETS IS NULL
)
OR (
NEW.ZHIGHLIGHTBEINGASSETS != OLD.ZHIGHLIGHTBEINGASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZASSETSCOUNT = MAX(0, IFNULL(ZASSETSCOUNT, 0) - 1)
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZASSETSCOUNT',
ZASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZASSET_ZHIGHLIGHTBEINGASSETS_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIGHLIGHTBEINGASSETS ON ZASSET
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
(
NEW.ZHIGHLIGHTBEINGASSETS IS NOT NULL
AND OLD.ZHIGHLIGHTBEINGASSETS IS NULL
)
OR (
NEW.ZHIGHLIGHTBEINGASSETS != OLD.ZHIGHLIGHTBEINGASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZASSETSCOUNT = IFNULL(ZASSETSCOUNT, 0) + 1
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZASSETSCOUNT',
ZASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZASSETSCOUNT = (
SELECT COUNT(Z_PK)
FROM ZASSET
WHERE (ZHIGHLIGHTBEINGASSETS = NEW.Z_PK)
AND (
ZHIDDEN == 0
AND ZTRASHEDSTATE == 0
)
)
WHERE Z_PK = NEW.Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZASSETSCOUNT',
ZASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.Z_PK;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPASSETSCOUNT_ZASSET_DELETE_DECREMENT
AFTER DELETE ON ZASSET FOR EACH ROW
WHEN OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPASSETSCOUNT, 0) - 1)
WHERE OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPASSETSCOUNT',
ZDAYGROUPASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPASSETSCOUNT_ZASSET_INSERT_INCREMENT
AFTER
INSERT ON ZASSET FOR EACH ROW
WHEN NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPASSETSCOUNT = IFNULL(ZDAYGROUPASSETSCOUNT, 0) + 1
WHERE NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPASSETSCOUNT',
ZDAYGROUPASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPASSETSCOUNT_ZASSET_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS == NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPASSETSCOUNT, 0) - 1)
WHERE OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPASSETSCOUNT',
ZDAYGROUPASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPASSETSCOUNT_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS == OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPASSETSCOUNT = IFNULL(ZDAYGROUPASSETSCOUNT, 0) + 1
WHERE NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPASSETSCOUNT',
ZDAYGROUPASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPASSETSCOUNT_ZASSET_ZDAYGROUPHIGHLIGHTBEINGASSETS_UPDATE_DECREMENT
AFTER
UPDATE OF ZDAYGROUPHIGHLIGHTBEINGASSETS ON ZASSET
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
(
OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS IS NOT NULL
AND NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS IS NULL
)
OR (
NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS != OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPASSETSCOUNT, 0) - 1)
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPASSETSCOUNT',
ZDAYGROUPASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPASSETSCOUNT_ZASSET_ZDAYGROUPHIGHLIGHTBEINGASSETS_UPDATE_INCREMENT
AFTER
UPDATE OF ZDAYGROUPHIGHLIGHTBEINGASSETS ON ZASSET
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
(
NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS IS NOT NULL
AND OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS IS NULL
)
OR (
NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS != OLD.ZDAYGROUPHIGHLIGHTBEINGASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPASSETSCOUNT = IFNULL(ZDAYGROUPASSETSCOUNT, 0) + 1
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPASSETSCOUNT',
ZDAYGROUPASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPASSETSCOUNT_ZASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPASSETSCOUNT = (
SELECT COUNT(Z_PK)
FROM ZASSET
WHERE (ZDAYGROUPHIGHLIGHTBEINGASSETS = NEW.Z_PK)
AND (
ZHIDDEN == 0
AND ZTRASHEDSTATE == 0
)
)
WHERE Z_PK = NEW.Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPASSETSCOUNT',
ZDAYGROUPASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.Z_PK;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPEXTENDEDASSETSCOUNT_ZASSET_DELETE_DECREMENT
AFTER DELETE ON ZASSET FOR EACH ROW
WHEN OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPEXTENDEDASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPEXTENDEDASSETSCOUNT, 0) - 1)
WHERE OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPEXTENDEDASSETSCOUNT',
ZDAYGROUPEXTENDEDASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPEXTENDEDASSETSCOUNT_ZASSET_INSERT_INCREMENT
AFTER
INSERT ON ZASSET FOR EACH ROW
WHEN NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPEXTENDEDASSETSCOUNT = IFNULL(ZDAYGROUPEXTENDEDASSETSCOUNT, 0) + 1
WHERE NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPEXTENDEDASSETSCOUNT',
ZDAYGROUPEXTENDEDASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPEXTENDEDASSETSCOUNT_ZASSET_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS == NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPEXTENDEDASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPEXTENDEDASSETSCOUNT, 0) - 1)
WHERE OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPEXTENDEDASSETSCOUNT',
ZDAYGROUPEXTENDEDASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPEXTENDEDASSETSCOUNT_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS == OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPEXTENDEDASSETSCOUNT = IFNULL(ZDAYGROUPEXTENDEDASSETSCOUNT, 0) + 1
WHERE NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPEXTENDEDASSETSCOUNT',
ZDAYGROUPEXTENDEDASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPEXTENDEDASSETSCOUNT_ZASSET_ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_DECREMENT
AFTER
UPDATE OF ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS ON ZASSET
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
(
OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS IS NOT NULL
AND NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS IS NULL
)
OR (
NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS != OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPEXTENDEDASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPEXTENDEDASSETSCOUNT, 0) - 1)
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPEXTENDEDASSETSCOUNT',
ZDAYGROUPEXTENDEDASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPEXTENDEDASSETSCOUNT_ZASSET_ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_INCREMENT
AFTER
UPDATE OF ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS ON ZASSET
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
(
NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS IS NOT NULL
AND OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS IS NULL
)
OR (
NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS != OLD.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPEXTENDEDASSETSCOUNT = IFNULL(ZDAYGROUPEXTENDEDASSETSCOUNT, 0) + 1
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPEXTENDEDASSETSCOUNT',
ZDAYGROUPEXTENDEDASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPEXTENDEDASSETSCOUNT_ZASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPEXTENDEDASSETSCOUNT = (
SELECT COUNT(Z_PK)
FROM ZASSET
WHERE (ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS = NEW.Z_PK)
AND (
ZHIDDEN == 0
AND ZTRASHEDSTATE == 0
)
)
WHERE Z_PK = NEW.Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPEXTENDEDASSETSCOUNT',
ZDAYGROUPEXTENDEDASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.Z_PK;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPSUMMARYASSETSCOUNT_ZASSET_DELETE_DECREMENT
AFTER DELETE ON ZASSET FOR EACH ROW
WHEN OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPSUMMARYASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPSUMMARYASSETSCOUNT, 0) - 1)
WHERE OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPSUMMARYASSETSCOUNT',
ZDAYGROUPSUMMARYASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPSUMMARYASSETSCOUNT_ZASSET_INSERT_INCREMENT
AFTER
INSERT ON ZASSET FOR EACH ROW
WHEN NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPSUMMARYASSETSCOUNT = IFNULL(ZDAYGROUPSUMMARYASSETSCOUNT, 0) + 1
WHERE NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPSUMMARYASSETSCOUNT',
ZDAYGROUPSUMMARYASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPSUMMARYASSETSCOUNT_ZASSET_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS == NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPSUMMARYASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPSUMMARYASSETSCOUNT, 0) - 1)
WHERE OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPSUMMARYASSETSCOUNT',
ZDAYGROUPSUMMARYASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPSUMMARYASSETSCOUNT_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS == OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPSUMMARYASSETSCOUNT = IFNULL(ZDAYGROUPSUMMARYASSETSCOUNT, 0) + 1
WHERE NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPSUMMARYASSETSCOUNT',
ZDAYGROUPSUMMARYASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPSUMMARYASSETSCOUNT_ZASSET_ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_DECREMENT
AFTER
UPDATE OF ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS ON ZASSET
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
(
OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS IS NOT NULL
AND NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS IS NULL
)
OR (
NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS != OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPSUMMARYASSETSCOUNT = MAX(0, IFNULL(ZDAYGROUPSUMMARYASSETSCOUNT, 0) - 1)
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPSUMMARYASSETSCOUNT',
ZDAYGROUPSUMMARYASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPSUMMARYASSETSCOUNT_ZASSET_ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_INCREMENT
AFTER
UPDATE OF ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS ON ZASSET
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
(
NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS IS NOT NULL
AND OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS IS NULL
)
OR (
NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS != OLD.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPSUMMARYASSETSCOUNT = IFNULL(ZDAYGROUPSUMMARYASSETSCOUNT, 0) + 1
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPSUMMARYASSETSCOUNT',
ZDAYGROUPSUMMARYASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZDAYGROUPSUMMARYASSETSCOUNT_ZASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZDAYGROUPSUMMARYASSETSCOUNT = (
SELECT COUNT(Z_PK)
FROM ZASSET
WHERE (ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS = NEW.Z_PK)
AND (
ZHIDDEN == 0
AND ZTRASHEDSTATE == 0
)
)
WHERE Z_PK = NEW.Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZDAYGROUPSUMMARYASSETSCOUNT',
ZDAYGROUPSUMMARYASSETSCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.Z_PK;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZEXTENDEDCOUNT_ZASSET_DELETE_DECREMENT
AFTER DELETE ON ZASSET FOR EACH ROW
WHEN OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZEXTENDEDCOUNT = MAX(0, IFNULL(ZEXTENDEDCOUNT, 0) - 1)
WHERE OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZEXTENDEDCOUNT',
ZEXTENDEDCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZEXTENDEDCOUNT_ZASSET_INSERT_INCREMENT
AFTER
INSERT ON ZASSET FOR EACH ROW
WHEN NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZEXTENDEDCOUNT = IFNULL(ZEXTENDEDCOUNT, 0) + 1
WHERE NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZEXTENDEDCOUNT',
ZEXTENDEDCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZEXTENDEDCOUNT_ZASSET_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS == NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZEXTENDEDCOUNT = MAX(0, IFNULL(ZEXTENDEDCOUNT, 0) - 1)
WHERE OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZEXTENDEDCOUNT',
ZEXTENDEDCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZEXTENDEDCOUNT_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS == OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZEXTENDEDCOUNT = IFNULL(ZEXTENDEDCOUNT, 0) + 1
WHERE NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZEXTENDEDCOUNT',
ZEXTENDEDCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZEXTENDEDCOUNT_ZASSET_ZHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIGHLIGHTBEINGEXTENDEDASSETS ON ZASSET
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
(
OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS IS NOT NULL
AND NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS IS NULL
)
OR (
NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS != OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZEXTENDEDCOUNT = MAX(0, IFNULL(ZEXTENDEDCOUNT, 0) - 1)
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZEXTENDEDCOUNT',
ZEXTENDEDCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZEXTENDEDCOUNT_ZASSET_ZHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIGHLIGHTBEINGEXTENDEDASSETS ON ZASSET
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
(
NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS IS NOT NULL
AND OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS IS NULL
)
OR (
NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS != OLD.ZHIGHLIGHTBEINGEXTENDEDASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZEXTENDEDCOUNT = IFNULL(ZEXTENDEDCOUNT, 0) + 1
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZEXTENDEDCOUNT',
ZEXTENDEDCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGEXTENDEDASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZEXTENDEDCOUNT_ZASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZEXTENDEDCOUNT = (
SELECT COUNT(Z_PK)
FROM ZASSET
WHERE (ZHIGHLIGHTBEINGEXTENDEDASSETS = NEW.Z_PK)
AND (
ZHIDDEN == 0
AND ZTRASHEDSTATE == 0
)
)
WHERE Z_PK = NEW.Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZEXTENDEDCOUNT',
ZEXTENDEDCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.Z_PK;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZASSET_DELETE_DECREMENT
AFTER DELETE ON ZASSET FOR EACH ROW
WHEN OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZSUMMARYCOUNT = MAX(0, IFNULL(ZSUMMARYCOUNT, 0) - 1)
WHERE OLD.ZHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZSUMMARYCOUNT',
ZSUMMARYCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZASSET_INSERT_INCREMENT
AFTER
INSERT ON ZASSET FOR EACH ROW
WHEN NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0 BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZSUMMARYCOUNT = IFNULL(ZSUMMARYCOUNT, 0) + 1
WHERE NEW.ZHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZSUMMARYCOUNT',
ZSUMMARYCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZASSET_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
OLD.ZHIGHLIGHTBEINGSUMMARYASSETS == NEW.ZHIGHLIGHTBEINGSUMMARYASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZSUMMARYCOUNT = MAX(0, IFNULL(ZSUMMARYCOUNT, 0) - 1)
WHERE OLD.ZHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZSUMMARYCOUNT',
ZSUMMARYCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZASSET_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIDDEN,
ZTRASHEDSTATE ON ZASSET FOR EACH ROW
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZTRASHEDSTATE != OLD.ZTRASHEDSTATE
)
AND (
NEW.ZHIGHLIGHTBEINGSUMMARYASSETS == OLD.ZHIGHLIGHTBEINGSUMMARYASSETS
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZSUMMARYCOUNT = IFNULL(ZSUMMARYCOUNT, 0) + 1
WHERE NEW.ZHIGHLIGHTBEINGSUMMARYASSETS = Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZSUMMARYCOUNT',
ZSUMMARYCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZASSET_ZHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_DECREMENT
AFTER
UPDATE OF ZHIGHLIGHTBEINGSUMMARYASSETS ON ZASSET
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZTRASHEDSTATE == 0
)
AND (
(
OLD.ZHIGHLIGHTBEINGSUMMARYASSETS IS NOT NULL
AND NEW.ZHIGHLIGHTBEINGSUMMARYASSETS IS NULL
)
OR (
NEW.ZHIGHLIGHTBEINGSUMMARYASSETS != OLD.ZHIGHLIGHTBEINGSUMMARYASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZSUMMARYCOUNT = MAX(0, IFNULL(ZSUMMARYCOUNT, 0) - 1)
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGSUMMARYASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZSUMMARYCOUNT',
ZSUMMARYCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = OLD.ZHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZASSET_ZHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_INCREMENT
AFTER
UPDATE OF ZHIGHLIGHTBEINGSUMMARYASSETS ON ZASSET
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZTRASHEDSTATE == 0
)
AND (
(
NEW.ZHIGHLIGHTBEINGSUMMARYASSETS IS NOT NULL
AND OLD.ZHIGHLIGHTBEINGSUMMARYASSETS IS NULL
)
OR (
NEW.ZHIGHLIGHTBEINGSUMMARYASSETS != OLD.ZHIGHLIGHTBEINGSUMMARYASSETS
)
) BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZSUMMARYCOUNT = IFNULL(ZSUMMARYCOUNT, 0) + 1
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGSUMMARYASSETS;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZSUMMARYCOUNT',
ZSUMMARYCOUNT
)
FROM ZPHOTOSHIGHLIGHT
WHERE Z_PK = NEW.ZHIGHLIGHTBEINGSUMMARYASSETS;
END;
CREATE TRIGGER ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE ZPHOTOSHIGHLIGHT
SET ZSUMMARYCOUNT = (
SELECT COUNT(Z_PK)
FROM ZASSET
WHERE (ZHIGHLIGHTBEINGSUMMARYASSETS = NEW.Z_PK)
AND (
ZHIDDEN == 0
AND ZTRASHEDSTATE == 0
)
)
WHERE Z_PK = NEW.Z_PK;
SELECT NSCoreDataTriggerUpdateAffectedObjectValue(
'ZPHOTOSHIGHLIGHT',
Z_ENT,
Z_PK,
'ZSUMMARYCOUNT',
ZSUMMARYCOUNT
)
FROM ZPHOTOSHIGHLIGHT
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_RT_Asset_boundedByRect_DELETE
AFTER DELETE ON ZASSET FOR EACH ROW BEGIN
DELETE FROM Z_RT_Asset_boundedByRect
WHERE Z_PK = OLD.Z_PK;
END;
CREATE TRIGGER Z_RT_Asset_boundedByRect_INSERT
AFTER
INSERT ON ZASSET FOR EACH ROW BEGIN
INSERT
OR REPLACE INTO Z_RT_Asset_boundedByRect (
Z_PK,
ZLATITUDE_MIN,
ZLATITUDE_MAX,
ZLONGITUDE_MIN,
ZLONGITUDE_MAX
)
VALUES (
NEW.Z_PK,
NEW.ZLATITUDE,
NEW.ZLATITUDE,
NEW.ZLONGITUDE,
NEW.ZLONGITUDE
);
END;
CREATE TRIGGER Z_RT_Asset_boundedByRect_UPDATE
AFTER
UPDATE ON ZASSET FOR EACH ROW BEGIN
DELETE FROM Z_RT_Asset_boundedByRect
WHERE Z_PK = NEW.Z_PK;
INSERT INTO Z_RT_Asset_boundedByRect (
Z_PK,
ZLATITUDE_MIN,
ZLATITUDE_MAX,
ZLONGITUDE_MIN,
ZLONGITUDE_MAX
)
VALUES (
NEW.Z_PK,
NEW.ZLATITUDE,
NEW.ZLATITUDE,
NEW.ZLONGITUDE,
NEW.ZLONGITUDE
);
END;
CREATE UNIQUE INDEX Z_GlobalKeyValue_UNIQUE_key ON ZGLOBALKEYVALUE (ZKEY 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_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
)