-
Notifications
You must be signed in to change notification settings - Fork 100
Photos 5 database schema
Rhet Turnbull edited this page Oct 4, 2020
·
2 revisions
The schema for Photos version 5 databases, as produced by sqlite3 Photos.sqlite ".schema"
is:
CREATE TABLE ZADDITIONALASSETATTRIBUTES (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZALLOWEDFORANALYSIS INTEGER,
ZCAMERACAPTUREDEVICE INTEGER,
ZCLOUDAVALANCHEPICKTYPE INTEGER,
ZCLOUDGROUPINGSTATE INTEGER,
ZCLOUDKINDSUBTYPE INTEGER,
ZCLOUDRECOVERYSTATE INTEGER,
ZCLOUDSTATERECOVERYATTEMPTSCOUNT INTEGER,
ZDESTINATIONASSETCOPYSTATE INTEGER,
ZEMBEDDEDTHUMBNAILHEIGHT INTEGER,
ZEMBEDDEDTHUMBNAILLENGTH INTEGER,
ZEMBEDDEDTHUMBNAILOFFSET INTEGER,
ZEMBEDDEDTHUMBNAILWIDTH 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,
ZSCENEANALYSISVERSION INTEGER,
ZSHARECOUNT INTEGER,
ZSHARETYPE INTEGER,
ZSHIFTEDLOCATIONISVALID INTEGER,
ZTIMEZONEOFFSET INTEGER,
ZUPLOADATTEMPTS INTEGER,
ZVARIATIONSUGGESTIONSTATES INTEGER,
ZVIDEOCPDISPLAYTIMESCALE INTEGER,
ZVIDEOCPDISPLAYVALUE INTEGER,
ZVIDEOCPDURATIONTIMESCALE INTEGER,
ZVIEWCOUNT INTEGER,
ZASSET INTEGER,
Z34_ASSET INTEGER,
ZASSETDESCRIPTION INTEGER,
ZEDITEDIPTCATTRIBUTES INTEGER,
ZMEDIAMETADATA INTEGER,
ZSCENEPRINT INTEGER,
ZUNMANAGEDADJUSTMENT INTEGER,
ZALTERNATEIMPORTIMAGEDATE TIMESTAMP,
ZLASTUPLOADATTEMPTDATE TIMESTAMP,
ZSCENEANALYSISTIMESTAMP TIMESTAMP,
ZADJUSTEDFINGERPRINT VARCHAR,
ZCREATORBUNDLEID VARCHAR,
ZEDITORBUNDLEID VARCHAR,
ZEXIFTIMESTAMPSTRING VARCHAR,
ZIMPORTSESSIONID VARCHAR,
ZMASTERFINGERPRINT VARCHAR,
ZMEDIAMETADATATYPE VARCHAR,
ZMONTAGE VARCHAR,
ZORIGINALASSETSUUID VARCHAR,
ZORIGINALFILENAME VARCHAR,
ZORIGINATINGASSETIDENTIFIER VARCHAR,
ZPHOTOSTREAMTAGID VARCHAR,
ZPUBLICGLOBALUUID VARCHAR,
ZSHAREORIGINATOR VARCHAR,
ZSNOWDAYIDENTIFIER VARCHAR,
ZSNOWDAYSNOWPLOWIDENTIFIER VARCHAR,
ZSNOWPLOWGROUPUUID VARCHAR,
ZTIMEZONENAME VARCHAR,
ZTITLE VARCHAR,
ZDISTANCEIDENTITY BLOB,
ZFACEREGIONS BLOB,
ZORIGINALHASH BLOB,
ZPLACEANNOTATIONDATA BLOB,
ZREVERSELOCATIONDATA BLOB,
ZSHIFTEDLOCATIONDATA BLOB
);
CREATE TABLE Z_1KEYWORDS (
Z_1ASSETATTRIBUTES INTEGER,
Z_37KEYWORDS INTEGER,
PRIMARY KEY (Z_1ASSETATTRIBUTES, Z_37KEYWORDS)
);
CREATE TABLE ZADJUSTMENT (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZIDENTIFIER INTEGER,
ZASSET INTEGER,
Z34_ASSET INTEGER,
Z_FOK_ASSET INTEGER,
ZFILTERNAME VARCHAR,
ZFILTERSETTINGS BLOB
);
CREATE TABLE ZALBUMLIST (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZIDENTIFIER INTEGER,
ZNEEDSREORDERINGNUMBER INTEGER,
ZUUID VARCHAR
);
CREATE TABLE ZASSETANALYSISSTATE (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZANALYSISSTATE INTEGER,
ZWORKERFLAGS INTEGER,
ZWORKERTYPE INTEGER,
ZASSET INTEGER,
Z34_ASSET 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 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,
ZMEDIAMETADATATYPE VARCHAR,
ZORIGINALFILENAME VARCHAR,
ZORIGINATINGASSETIDENTIFIER 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,
Z34_ASSET 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,
Z34_COMMENTEDASSET INTEGER,
ZLIKEDASSET INTEGER,
Z34_LIKEDASSET INTEGER,
Z_FOK_LIKEDASSET INTEGER,
Z_FOK_CLOUDFEEDCOMMENTENTRY INTEGER,
Z_FOK_COMMENTEDASSET INTEGER,
Z_FOK_CLOUDFEEDLIKECOMMENTENTRY INTEGER,
ZCOMMENTCLIENTDATE TIMESTAMP,
ZCOMMENTDATE TIMESTAMP,
ZCLOUDGUID VARCHAR,
ZCOMMENTTEXT VARCHAR,
ZCOMMENTTYPE VARCHAR,
ZCOMMENTERHASHEDPERSONID VARCHAR
);
CREATE TABLE ZCODEC (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZFOURCHARCODENAME VARCHAR
);
CREATE TABLE ZCOMPUTEDASSETATTRIBUTES (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZASSET INTEGER,
Z34_ASSET 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,
ZBALDTYPE INTEGER,
ZCLOUDLOCALSTATE INTEGER,
ZCLOUDNAMESOURCE INTEGER,
ZCLUSTERSEQUENCENUMBER INTEGER,
ZCONFIRMEDFACECROPGENERATIONSTATE INTEGER,
ZEYEMAKEUPTYPE INTEGER,
ZEYESSTATE INTEGER,
ZFACEALGORITHMVERSION INTEGER,
ZFACIALHAIRTYPE INTEGER,
ZGENDERTYPE INTEGER,
ZGLASSESTYPE INTEGER,
ZHAIRCOLORTYPE INTEGER,
ZHASSMILE INTEGER,
ZHIDDEN INTEGER,
ZISINTRASH INTEGER,
ZISLEFTEYECLOSED INTEGER,
ZISRIGHTEYECLOSED INTEGER,
ZLIPMAKEUPTYPE INTEGER,
ZMANUAL INTEGER,
ZNAMESOURCE INTEGER,
ZQUALITYMEASURE INTEGER,
ZSMILETYPE INTEGER,
ZSOURCEHEIGHT INTEGER,
ZSOURCEWIDTH INTEGER,
ZTRAININGTYPE INTEGER,
ZASSET INTEGER,
Z34_ASSET INTEGER,
ZFACECROP INTEGER,
ZFACEGROUP INTEGER,
ZFACEGROUPBEINGKEYFACE INTEGER,
ZFACEPRINT INTEGER,
ZPERSON INTEGER,
ZPERSONBEINGKEYFACE INTEGER,
ZADJUSTMENTVERSION TIMESTAMP,
ZBLURSCORE FLOAT,
ZCENTERX FLOAT,
ZCENTERY 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 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 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 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,
ZISO INTEGER,
ZMETERINGMODE INTEGER,
ZSAMPLERATE INTEGER,
ZTRACKFORMAT INTEGER,
ZWHITEBALANCE INTEGER,
ZASSET INTEGER,
ZAPERTURE FLOAT,
ZBITRATE FLOAT,
ZDURATION FLOAT,
ZEXPOSUREBIAS FLOAT,
ZFOCALLENGTH FLOAT,
ZFPS FLOAT,
ZLATITUDE FLOAT,
ZLONGITUDE FLOAT,
ZSHUTTERSPEED 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,
Z34_ASSET 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,
ZKIND INTEGER,
ZPENDINGITEMSCOUNT INTEGER,
ZPENDINGITEMSTYPE INTEGER,
ZSYNCEVENTORDERKEY INTEGER,
ZTRASHEDSTATE INTEGER,
ZCUSTOMKEYASSET INTEGER,
Z34_CUSTOMKEYASSET INTEGER,
ZKEYASSET INTEGER,
Z34_KEYASSET INTEGER,
ZPARENTFOLDER INTEGER,
ZSECONDARYKEYASSET INTEGER,
Z34_SECONDARYKEYASSET INTEGER,
ZTERTIARYKEYASSET INTEGER,
Z34_TERTIARYKEYASSET 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,
Z_FOK_PARENTFOLDER INTEGER,
ZCREATIONDATE TIMESTAMP,
ZENDDATE TIMESTAMP,
ZSTARTDATE TIMESTAMP,
ZTRASHEDDATE TIMESTAMP,
ZCLOUDCREATIONDATE TIMESTAMP,
ZCLOUDLASTCONTRIBUTIONDATE TIMESTAMP,
ZCLOUDLASTINTERESTINGCHANGEDATE TIMESTAMP,
ZCLOUDSUBSCRIPTIONDATE TIMESTAMP,
ZCLOUDGUID VARCHAR,
ZIMPORTSESSIONID 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 Z_25ALBUMLISTS (
Z_25ALBUMS INTEGER,
Z_3ALBUMLISTS INTEGER,
Z_FOK_25ALBUMS INTEGER,
PRIMARY KEY (Z_25ALBUMS, Z_3ALBUMLISTS)
);
CREATE TABLE Z_26ASSETS (
Z_26ALBUMS INTEGER,
Z_34ASSETS INTEGER,
Z_FOK_34ASSETS INTEGER,
PRIMARY KEY (Z_26ALBUMS, Z_34ASSETS)
);
CREATE TABLE ZGENERICASSET (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZAVALANCHEPICKTYPE INTEGER,
ZCLOUDDELETESTATE INTEGER,
ZCLOUDDOWNLOADREQUESTS INTEGER,
ZCLOUDHASCOMMENTSBYME INTEGER,
ZCLOUDHASCOMMENTSCONVERSATION INTEGER,
ZCLOUDHASUNSEENCOMMENTS INTEGER,
ZCLOUDISDELETABLE INTEGER,
ZCLOUDISMYASSET INTEGER,
ZCLOUDLOCALSTATE INTEGER,
ZCLOUDPLACEHOLDERKIND INTEGER,
ZCOMPLETE INTEGER,
ZCUSTOMRENDEREDVALUE INTEGER,
ZDEFERREDPROCESSINGNEEDED INTEGER,
ZDEPTHSTATES INTEGER,
ZFACEAREAPOINTS INTEGER,
ZFAVORITE INTEGER,
ZGROUPINGSTATE INTEGER,
ZHASADJUSTMENTS INTEGER,
ZHEIGHT INTEGER,
ZHIDDEN INTEGER,
ZKIND INTEGER,
ZKINDSUBTYPE INTEGER,
ZLOCALRESOURCESSTATE INTEGER,
ZORIENTATION INTEGER,
ZPACKEDACCEPTABLECROPRECT INTEGER,
ZPACKEDBADGEATTRIBUTES INTEGER,
ZPACKEDPREFERREDCROPRECT INTEGER,
ZPLAYBACKSTYLE INTEGER,
ZPLAYBACKVARIATION INTEGER,
ZSAVEDASSETTYPE INTEGER,
ZSNOWPLOWSTATE INTEGER,
ZTHUMBNAILINDEX INTEGER,
ZTRASHEDSTATE INTEGER,
ZVIDEOCPDURATIONVALUE INTEGER,
ZVIDEOCPVISIBILITYSTATE INTEGER,
ZVISIBILITYSTATE INTEGER,
ZWIDTH INTEGER,
ZADDITIONALATTRIBUTES INTEGER,
ZCLOUDFEEDASSETSENTRY INTEGER,
ZCOMPUTEDATTRIBUTES INTEGER,
ZDAYGROUPHIGHLIGHTBEINGASSETS INTEGER,
ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS INTEGER,
ZDAYGROUPHIGHLIGHTBEINGKEYASSET INTEGER,
ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS INTEGER,
ZEXTENDEDATTRIBUTES INTEGER,
ZHIGHLIGHTBEINGASSETS INTEGER,
ZHIGHLIGHTBEINGEXTENDEDASSETS INTEGER,
ZHIGHLIGHTBEINGKEYASSET INTEGER,
ZHIGHLIGHTBEINGSUMMARYASSETS INTEGER,
ZIMPORTSESSION INTEGER,
ZMASTER INTEGER,
ZMEDIAANALYSISATTRIBUTES INTEGER,
ZMOMENT INTEGER,
ZMOMENTSHARE INTEGER,
ZMONTHHIGHLIGHTBEINGFIRSTASSET INTEGER,
ZMONTHHIGHLIGHTBEINGKEYASSET INTEGER,
ZSEARCHDATA INTEGER,
ZSOURCEASSETFORDUPLICATION INTEGER,
Z34_SOURCEASSETFORDUPLICATION INTEGER,
ZYEARHIGHLIGHTBEINGKEYASSET INTEGER,
Z_FOK_IMPORTSESSION 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,
ZGROUPINGUUID VARCHAR,
ZMEDIAGROUPUUID VARCHAR,
ZORIGINALCOLORSPACE VARCHAR,
ZUNIFORMTYPEIDENTIFIER VARCHAR,
ZUUID VARCHAR,
ZIMAGEREQUESTHINTS BLOB,
ZLOCATIONDATA BLOB
);
CREATE TABLE Z_34SUGGESTIONSBEINGREPRESENTATIVEASSETS (
Z_34REPRESENTATIVEASSETS1 INTEGER,
Z_52SUGGESTIONSBEINGREPRESENTATIVEASSETS INTEGER,
PRIMARY KEY (
Z_34REPRESENTATIVEASSETS1,
Z_52SUGGESTIONSBEINGREPRESENTATIVEASSETS
)
);
CREATE TABLE Z_34SUGGESTIONSBEINGKEYASSETS (
Z_34KEYASSETS INTEGER,
Z_52SUGGESTIONSBEINGKEYASSETS INTEGER,
PRIMARY KEY (Z_34KEYASSETS, Z_52SUGGESTIONSBEINGKEYASSETS)
);
CREATE TABLE Z_34MEMORIESBEINGREPRESENTATIVEASSETS (
Z_34REPRESENTATIVEASSETS INTEGER,
Z_40MEMORIESBEINGREPRESENTATIVEASSETS INTEGER,
PRIMARY KEY (
Z_34REPRESENTATIVEASSETS,
Z_40MEMORIESBEINGREPRESENTATIVEASSETS
)
);
CREATE TABLE Z_34MEMORIESBEINGMOVIECURATEDASSETS (
Z_34MOVIECURATEDASSETS INTEGER,
Z_40MEMORIESBEINGMOVIECURATEDASSETS INTEGER,
PRIMARY KEY (
Z_34MOVIECURATEDASSETS,
Z_40MEMORIESBEINGMOVIECURATEDASSETS
)
);
CREATE TABLE Z_34MEMORIESBEINGCURATEDASSETS (
Z_34CURATEDASSETS INTEGER,
Z_40MEMORIESBEINGCURATEDASSETS INTEGER,
PRIMARY KEY (
Z_34CURATEDASSETS,
Z_40MEMORIESBEINGCURATEDASSETS
)
);
CREATE TABLE Z_34MEMORIESBEINGEXTENDEDCURATEDASSETS (
Z_34EXTENDEDCURATEDASSETS INTEGER,
Z_40MEMORIESBEINGEXTENDEDCURATEDASSETS INTEGER,
PRIMARY KEY (
Z_34EXTENDEDCURATEDASSETS,
Z_40MEMORIESBEINGEXTENDEDCURATEDASSETS
)
);
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,
ZVERSION INTEGER,
ZASSET INTEGER,
Z34_ASSET INTEGER,
ZCODEC INTEGER,
ZFILESYSTEMBOOKMARK INTEGER,
ZFILESYSTEMVOLUME INTEGER,
ZTRANSIENTCLOUDMASTER INTEGER,
ZUNIFORMTYPEIDENTIFIER INTEGER,
ZCLOUDLASTONDEMANDDOWNLOADDATE TIMESTAMP,
ZCLOUDLASTPREFETCHDATE TIMESTAMP,
ZCLOUDMASTERDATECREATED TIMESTAMP,
ZCLOUDPRUNEDAT TIMESTAMP,
ZTRASHEDDATE TIMESTAMP,
ZCLOUDDELETEASSETUUIDWITHRESOURCETYPE 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,
Z34_ASSET INTEGER,
ZALBUMUUID VARCHAR,
ZRELATIVERECTVALUE BLOB
);
CREATE TABLE ZMEDIAANALYSISASSETATTRIBUTES (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZAUDIOCLASSIFICATION INTEGER,
ZBESTKEYFRAMETIMESCALE INTEGER,
ZBESTKEYFRAMEVALUE INTEGER,
ZBESTVIDEORANGEDURATIONTIMESCALE INTEGER,
ZBESTVIDEORANGEDURATIONVALUE INTEGER,
ZBESTVIDEORANGESTARTTIMESCALE INTEGER,
ZBESTVIDEORANGESTARTVALUE INTEGER,
ZFACECOUNT INTEGER,
ZMEDIAANALYSISVERSION INTEGER,
ZPACKEDBESTPLAYBACKRECT INTEGER,
ZASSET INTEGER,
Z34_ASSET INTEGER,
ZACTIVITYSCORE FLOAT,
ZAUTOPLAYSUGGESTIONSCORE FLOAT,
ZBLURRINESSSCORE FLOAT,
ZEXPOSURESCORE FLOAT,
ZMEDIAANALYSISTIMESTAMP TIMESTAMP,
ZVIDEOSCORE FLOAT
);
CREATE TABLE ZMEMORY (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZCATEGORY INTEGER,
ZCLOUDDELETESTATE INTEGER,
ZCLOUDLOCALSTATE INTEGER,
ZFAVORITE INTEGER,
ZNOTIFICATIONSTATE INTEGER,
ZPENDING INTEGER,
ZPENDINGPLAYCOUNT INTEGER,
ZPENDINGSHARECOUNT INTEGER,
ZPENDINGVIEWCOUNT INTEGER,
ZPHOTOSGRAPHVERSION INTEGER,
ZPLAYCOUNT INTEGER,
ZREJECTED INTEGER,
ZSHARECOUNT INTEGER,
ZSUBCATEGORY INTEGER,
ZUSERCREATED INTEGER,
ZVIEWCOUNT INTEGER,
ZKEYASSET INTEGER,
Z34_KEYASSET INTEGER,
ZCREATIONDATE TIMESTAMP,
ZLASTMOVIEPLAYEDDATE TIMESTAMP,
ZLASTVIEWEDDATE TIMESTAMP,
ZSCORE FLOAT,
ZSUBTITLE VARCHAR,
ZTITLE VARCHAR,
ZUUID VARCHAR,
ZMOVIEASSETSTATE BLOB,
ZASSETLISTPREDICATE BLOB,
ZBLACKLISTEDFEATURE BLOB,
ZMOVIEDATA BLOB,
ZPHOTOSGRAPHDATA BLOB
);
CREATE TABLE ZMOMENT (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZCACHEDCOUNT INTEGER,
ZCACHEDPHOTOSCOUNT INTEGER,
ZCACHEDVIDEOSCOUNT INTEGER,
ZPROCESSEDLOCATION INTEGER,
ZTIMEZONEOFFSET INTEGER,
ZTRASHEDSTATE INTEGER,
ZHIGHLIGHT INTEGER,
ZMEGAMOMENTLIST INTEGER,
ZYEARMOMENTLIST INTEGER,
ZAGGREGATIONSCORE FLOAT,
ZAPPROXIMATELATITUDE FLOAT,
ZAPPROXIMATELONGITUDE FLOAT,
ZENDDATE TIMESTAMP,
ZMODIFICATIONDATE TIMESTAMP,
ZREPRESENTATIVEDATE TIMESTAMP,
ZSTARTDATE TIMESTAMP,
ZSUBTITLE VARCHAR,
ZTITLE VARCHAR,
ZUUID VARCHAR,
ZLOCALIZEDLOCATIONNAMES BLOB
);
CREATE TABLE ZMOMENTLIST (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZGRANULARITYLEVEL INTEGER,
ZSORTINDEX INTEGER,
ZTRASHEDSTATE INTEGER,
ZENDDATE TIMESTAMP,
ZREPRESENTATIVEDATE TIMESTAMP,
ZSTARTDATE TIMESTAMP,
ZUUID VARCHAR
);
CREATE TABLE ZMOMENTSHARE (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZASSETCOUNT INTEGER,
ZCLOUDDELETESTATE INTEGER,
ZLOCALPUBLISHSTATE INTEGER,
ZMODE INTEGER,
ZPHOTOSCOUNT INTEGER,
ZSHOULDIGNOREBUDGETS INTEGER,
ZSHOULDNOTIFYONUPLOADCOMPLETION INTEGER,
ZSTATUS INTEGER,
ZTRASHEDSTATE INTEGER,
ZUPLOADEDPHOTOSCOUNT INTEGER,
ZUPLOADEDVIDEOSCOUNT INTEGER,
ZVIDEOSCOUNT INTEGER,
ZCREATIONDATE TIMESTAMP,
ZENDDATE TIMESTAMP,
ZEXPIRYDATE TIMESTAMP,
ZSTARTDATE TIMESTAMP,
ZORIGINATINGSCOPEIDENTIFIER VARCHAR,
ZSCOPEIDENTIFIER VARCHAR,
ZTITLE VARCHAR,
ZUUID VARCHAR,
ZSHAREURL VARCHAR,
ZPREVIEWDATA BLOB,
ZTHUMBNAILIMAGEDATA BLOB
);
CREATE TABLE ZMOMENTSHAREPARTICIPANT (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZSTATUS INTEGER,
ZTYPE INTEGER,
ZMOMENTSHARE INTEGER,
ZEMAILADDRESS VARCHAR,
ZPHONENUMBER VARCHAR,
ZUSERIDENTIFIER VARCHAR,
ZUUID VARCHAR,
ZNAMECOMPONENTS BLOB
);
CREATE TABLE ZPERSON (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZAGETYPE INTEGER,
ZCLOUDDELETESTATE INTEGER,
ZCLOUDLOCALSTATE INTEGER,
ZCLOUDVERIFIEDTYPE INTEGER,
ZFACECOUNT INTEGER,
ZGENDERTYPE INTEGER,
ZINPERSONNAMINGMODEL INTEGER,
ZKEYFACEPICKSOURCE INTEGER,
ZMANUALORDER INTEGER,
ZQUESTIONTYPE INTEGER,
ZTYPE INTEGER,
ZVERIFIEDTYPE INTEGER,
ZASSOCIATEDFACEGROUP INTEGER,
ZKEYFACE INTEGER,
ZMERGETARGETPERSON INTEGER,
ZDISPLAYNAME VARCHAR,
ZFULLNAME VARCHAR,
ZPERSONUUID VARCHAR,
ZPERSONURI VARCHAR,
ZCONTACTMATCHINGDICTIONARY BLOB
);
CREATE TABLE Z_45MERGECANDIDATES (
Z_45MERGECANDIDATES INTEGER,
REFLEXIVE INTEGER,
PRIMARY KEY (Z_45MERGECANDIDATES, REFLEXIVE)
);
CREATE TABLE Z_45INVALIDMERGECANDIDATES (
Z_45INVALIDMERGECANDIDATES INTEGER,
REFLEXIVE INTEGER,
PRIMARY KEY (Z_45INVALIDMERGECANDIDATES, REFLEXIVE)
);
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,
ZISCURATED INTEGER,
ZKIND INTEGER,
ZMOOD INTEGER,
ZSTARTTIMEZONEOFFSET INTEGER,
ZSUMMARYCOUNT INTEGER,
ZTYPE INTEGER,
ZVISIBILITYSTATE INTEGER,
ZDAYGROUPKEYASSET INTEGER,
Z34_DAYGROUPKEYASSET INTEGER,
ZKEYASSET INTEGER,
Z34_KEYASSET INTEGER,
ZMONTHFIRSTASSET INTEGER,
Z34_MONTHFIRSTASSET INTEGER,
ZMONTHKEYASSET INTEGER,
Z34_MONTHKEYASSET INTEGER,
ZPARENTDAYGROUPPHOTOSHIGHLIGHT INTEGER,
ZPARENTPHOTOSHIGHLIGHT INTEGER,
ZYEARKEYASSET INTEGER,
Z34_YEARKEYASSET INTEGER,
ZENDDATE TIMESTAMP,
ZPROMOTIONSCORE FLOAT,
ZSTARTDATE TIMESTAMP,
ZSUBTITLE VARCHAR,
ZTITLE VARCHAR,
ZUUID VARCHAR,
ZVERBOSESMARTDESCRIPTION VARCHAR
);
CREATE TABLE ZSCENECLASSIFICATION (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT 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 ZSEARCHDATA (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZVALID INTEGER,
ZASSET INTEGER,
Z34_ASSET INTEGER,
ZDATA 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,
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 ZUNIFORMTYPEIDENTIFIER (
Z_PK INTEGER PRIMARY KEY,
Z_ENT INTEGER,
Z_OPT INTEGER,
ZCONFORMSTOIMAGE INTEGER,
ZCONFORMSTOMOVIE INTEGER,
ZCONFORMSTORAWIMAGE INTEGER,
ZIDENTIFIER VARCHAR
);
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 INDEX ZADDITIONALASSETATTRIBUTES_ZASSET_INDEX ON ZADDITIONALASSETATTRIBUTES (ZASSET);
CREATE INDEX ZADDITIONALASSETATTRIBUTES_ZASSETDESCRIPTION_INDEX ON ZADDITIONALASSETATTRIBUTES (ZASSETDESCRIPTION);
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 Z_1KEYWORDS_Z_37KEYWORDS_INDEX ON Z_1KEYWORDS (Z_37KEYWORDS, Z_1ASSETATTRIBUTES);
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_byCreatorBundleIDIndex ON ZADDITIONALASSETATTRIBUTES (ZCREATORBUNDLEID 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_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_byUploadAttemptsIndex ON ZADDITIONALASSETATTRIBUTES (ZUPLOADATTEMPTS COLLATE BINARY ASC);
CREATE INDEX ZADJUSTMENT_ZASSET_INDEX ON ZADJUSTMENT (ZASSET);
CREATE INDEX Z_AlbumList_byIdentifierIndex ON ZALBUMLIST (ZIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_AlbumList_byUuidIndex ON ZALBUMLIST (ZUUID COLLATE BINARY ASC);
CREATE INDEX ZASSETANALYSISSTATE_ZASSET_INDEX ON ZASSETANALYSISSTATE (ZASSET);
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 ZASSETDESCRIPTION_ZASSETATTRIBUTES_INDEX ON ZASSETDESCRIPTION (ZASSETATTRIBUTES);
CREATE INDEX ZCLOUDFEEDENTRY_Z_ENT_INDEX ON ZCLOUDFEEDENTRY (Z_ENT);
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 ZCLOUDMASTER_ZMEDIAMETADATA_INDEX ON ZCLOUDMASTER (ZMEDIAMETADATA);
CREATE INDEX ZCLOUDMASTER_ZMOMENTSHARE_INDEX ON ZCLOUDMASTER (ZMOMENTSHARE);
CREATE INDEX Z_CloudMaster_byCloudLocalStateIndex ON ZCLOUDMASTER (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_CloudMaster_byCloudMasterGUIDIndex ON ZCLOUDMASTER (ZCLOUDMASTERGUID COLLATE BINARY ASC);
CREATE INDEX ZCLOUDMASTERMEDIAMETADATA_ZADDITIONALASSETATTRIBUTES_INDEX ON ZCLOUDMASTERMEDIAMETADATA (ZADDITIONALASSETATTRIBUTES);
CREATE INDEX ZCLOUDMASTERMEDIAMETADATA_ZCLOUDMASTER_INDEX ON ZCLOUDMASTERMEDIAMETADATA (ZCLOUDMASTER);
CREATE INDEX ZCLOUDRESOURCE_ZASSET_INDEX ON ZCLOUDRESOURCE (ZASSET);
CREATE INDEX ZCLOUDRESOURCE_ZCLOUDMASTER_INDEX ON ZCLOUDRESOURCE (ZCLOUDMASTER);
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 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 Z_CloudSharedComment_byCloudGUIDIndex ON ZCLOUDSHAREDCOMMENT (ZCLOUDGUID COLLATE BINARY ASC);
CREATE UNIQUE INDEX Z_Codec_UNIQUE_fourCharCodeName ON ZCODEC (ZFOURCHARCODENAME COLLATE BINARY ASC);
CREATE INDEX ZCOMPUTEDASSETATTRIBUTES_ZASSET_INDEX ON ZCOMPUTEDASSETATTRIBUTES (ZASSET);
CREATE INDEX Z_DeferredRebuildFace_byAssetCloudGUIDIndex ON ZDEFERREDREBUILDFACE (ZASSETCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX ZDETECTEDFACE_ZASSET_INDEX ON ZDETECTEDFACE (ZASSET);
CREATE INDEX ZDETECTEDFACE_ZFACECROP_INDEX ON ZDETECTEDFACE (ZFACECROP);
CREATE INDEX ZDETECTEDFACE_ZFACEGROUP_INDEX ON ZDETECTEDFACE (ZFACEGROUP);
CREATE INDEX ZDETECTEDFACE_ZFACEGROUPBEINGKEYFACE_INDEX ON ZDETECTEDFACE (ZFACEGROUPBEINGKEYFACE);
CREATE INDEX ZDETECTEDFACE_ZFACEPRINT_INDEX ON ZDETECTEDFACE (ZFACEPRINT);
CREATE INDEX ZDETECTEDFACE_ZPERSON_INDEX ON ZDETECTEDFACE (ZPERSON);
CREATE INDEX ZDETECTEDFACE_ZPERSONBEINGKEYFACE_INDEX ON ZDETECTEDFACE (ZPERSONBEINGKEYFACE);
CREATE INDEX Z_17CLUSTERREJECTEDPERSONS_Z_45CLUSTERREJECTEDPERSONS_INDEX ON Z_17CLUSTERREJECTEDPERSONS (
Z_45CLUSTERREJECTEDPERSONS,
Z_17CLUSTERREJECTEDFACES
);
CREATE INDEX Z_17REJECTEDPERSONS_Z_45REJECTEDPERSONS_INDEX ON Z_17REJECTEDPERSONS (Z_45REJECTEDPERSONS, Z_17REJECTEDFACES);
CREATE INDEX Z_17REJECTEDPERSONSNEEDINGFACECROPS_Z_45REJECTEDPERSONSNEEDINGFACECROPS_INDEX ON Z_17REJECTEDPERSONSNEEDINGFACECROPS (
Z_45REJECTEDPERSONSNEEDINGFACECROPS,
Z_17REJECTEDFACESNEEDINGFACECROPS
);
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 ZDETECTEDFACEGROUP_ZASSOCIATEDPERSON_INDEX ON ZDETECTEDFACEGROUP (ZASSOCIATEDPERSON);
CREATE INDEX ZDETECTEDFACEGROUP_ZKEYFACE_INDEX ON ZDETECTEDFACEGROUP (ZKEYFACE);
CREATE INDEX Z_DetectedFaceGroup_byPersonBuilderStateIndex ON ZDETECTEDFACEGROUP (ZPERSONBUILDERSTATE COLLATE BINARY ASC);
CREATE INDEX ZDETECTEDFACEPRINT_ZFACE_INDEX ON ZDETECTEDFACEPRINT (ZFACE);
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 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 ZFILESYSTEMBOOKMARK_ZRESOURCE_INDEX ON ZFILESYSTEMBOOKMARK (ZRESOURCE);
CREATE INDEX Z_FileSystemVolume_byUuidIndex ON ZFILESYSTEMVOLUME (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_FileSystemVolume_byVolumeUuidStringIndex ON ZFILESYSTEMVOLUME (ZVOLUMEUUIDSTRING COLLATE BINARY ASC);
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 Z_25ALBUMLISTS_Z_3ALBUMLISTS_INDEX ON Z_25ALBUMLISTS (Z_3ALBUMLISTS, Z_25ALBUMS);
CREATE INDEX ZGENERICALBUM_Z_ENT_INDEX ON ZGENERICALBUM (Z_ENT);
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);
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_26ASSETS_Z_34ASSETS_INDEX ON Z_26ASSETS (Z_34ASSETS, Z_26ALBUMS);
CREATE INDEX ZGENERICASSET_ZADDITIONALATTRIBUTES_INDEX ON ZGENERICASSET (ZADDITIONALATTRIBUTES);
CREATE INDEX ZGENERICASSET_ZCLOUDFEEDASSETSENTRY_INDEX ON ZGENERICASSET (ZCLOUDFEEDASSETSENTRY);
CREATE INDEX ZGENERICASSET_ZCOMPUTEDATTRIBUTES_INDEX ON ZGENERICASSET (ZCOMPUTEDATTRIBUTES);
CREATE INDEX ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGASSETS_INDEX ON ZGENERICASSET (ZDAYGROUPHIGHLIGHTBEINGASSETS);
CREATE INDEX ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS_INDEX ON ZGENERICASSET (ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS);
CREATE INDEX ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGKEYASSET_INDEX ON ZGENERICASSET (ZDAYGROUPHIGHLIGHTBEINGKEYASSET);
CREATE INDEX ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS_INDEX ON ZGENERICASSET (ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS);
CREATE INDEX ZGENERICASSET_ZEXTENDEDATTRIBUTES_INDEX ON ZGENERICASSET (ZEXTENDEDATTRIBUTES);
CREATE INDEX ZGENERICASSET_ZHIGHLIGHTBEINGASSETS_INDEX ON ZGENERICASSET (ZHIGHLIGHTBEINGASSETS);
CREATE INDEX ZGENERICASSET_ZHIGHLIGHTBEINGEXTENDEDASSETS_INDEX ON ZGENERICASSET (ZHIGHLIGHTBEINGEXTENDEDASSETS);
CREATE INDEX ZGENERICASSET_ZHIGHLIGHTBEINGKEYASSET_INDEX ON ZGENERICASSET (ZHIGHLIGHTBEINGKEYASSET);
CREATE INDEX ZGENERICASSET_ZHIGHLIGHTBEINGSUMMARYASSETS_INDEX ON ZGENERICASSET (ZHIGHLIGHTBEINGSUMMARYASSETS);
CREATE INDEX ZGENERICASSET_ZIMPORTSESSION_INDEX ON ZGENERICASSET (ZIMPORTSESSION);
CREATE INDEX ZGENERICASSET_ZMASTER_INDEX ON ZGENERICASSET (ZMASTER);
CREATE INDEX ZGENERICASSET_ZMEDIAANALYSISATTRIBUTES_INDEX ON ZGENERICASSET (ZMEDIAANALYSISATTRIBUTES);
CREATE INDEX ZGENERICASSET_ZMOMENT_INDEX ON ZGENERICASSET (ZMOMENT);
CREATE INDEX ZGENERICASSET_ZMOMENTSHARE_INDEX ON ZGENERICASSET (ZMOMENTSHARE);
CREATE INDEX ZGENERICASSET_ZMONTHHIGHLIGHTBEINGFIRSTASSET_INDEX ON ZGENERICASSET (ZMONTHHIGHLIGHTBEINGFIRSTASSET);
CREATE INDEX ZGENERICASSET_ZMONTHHIGHLIGHTBEINGKEYASSET_INDEX ON ZGENERICASSET (ZMONTHHIGHLIGHTBEINGKEYASSET);
CREATE INDEX ZGENERICASSET_ZSEARCHDATA_INDEX ON ZGENERICASSET (ZSEARCHDATA);
CREATE INDEX ZGENERICASSET_ZSOURCEASSETFORDUPLICATION_INDEX ON ZGENERICASSET (ZSOURCEASSETFORDUPLICATION);
CREATE INDEX ZGENERICASSET_ZYEARHIGHLIGHTBEINGKEYASSET_INDEX ON ZGENERICASSET (ZYEARHIGHLIGHTBEINGKEYASSET);
CREATE INDEX Z_34SUGGESTIONSBEINGREPRESENTATIVEASSETS_Z_51SUGGESTIONSBEINGREPRESENTATIVEASSETS_INDEX ON Z_34SUGGESTIONSBEINGREPRESENTATIVEASSETS (
Z_52SUGGESTIONSBEINGREPRESENTATIVEASSETS,
Z_34REPRESENTATIVEASSETS1
);
CREATE INDEX Z_34SUGGESTIONSBEINGKEYASSETS_Z_51SUGGESTIONSBEINGKEYASSETS_INDEX ON Z_34SUGGESTIONSBEINGKEYASSETS (Z_52SUGGESTIONSBEINGKEYASSETS, Z_34KEYASSETS);
CREATE INDEX Z_34MEMORIESBEINGREPRESENTATIVEASSETS_Z_40MEMORIESBEINGREPRESENTATIVEASSETS_INDEX ON Z_34MEMORIESBEINGREPRESENTATIVEASSETS (
Z_40MEMORIESBEINGREPRESENTATIVEASSETS,
Z_34REPRESENTATIVEASSETS
);
CREATE INDEX Z_34MEMORIESBEINGMOVIECURATEDASSETS_Z_40MEMORIESBEINGMOVIECURATEDASSETS_INDEX ON Z_34MEMORIESBEINGMOVIECURATEDASSETS (
Z_40MEMORIESBEINGMOVIECURATEDASSETS,
Z_34MOVIECURATEDASSETS
);
CREATE INDEX Z_34MEMORIESBEINGCURATEDASSETS_Z_40MEMORIESBEINGCURATEDASSETS_INDEX ON Z_34MEMORIESBEINGCURATEDASSETS (
Z_40MEMORIESBEINGCURATEDASSETS,
Z_34CURATEDASSETS
);
CREATE INDEX Z_34MEMORIESBEINGEXTENDEDCURATEDASSETS_Z_40MEMORIESBEINGEXTENDEDCURATEDASSETS_INDEX ON Z_34MEMORIESBEINGEXTENDEDCURATEDASSETS (
Z_40MEMORIESBEINGEXTENDEDCURATEDASSETS,
Z_34EXTENDEDCURATEDASSETS
);
CREATE INDEX ZINTERNALRESOURCE_ZASSET_INDEX ON ZINTERNALRESOURCE (ZASSET);
CREATE INDEX ZINTERNALRESOURCE_ZCODEC_INDEX ON ZINTERNALRESOURCE (ZCODEC);
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 ZINTERNALRESOURCE_ZUNIFORMTYPEIDENTIFIER_INDEX ON ZINTERNALRESOURCE (ZUNIFORMTYPEIDENTIFIER);
CREATE INDEX Z_Keyword_byTitleIndex ON ZKEYWORD (ZTITLE COLLATE BINARY ASC);
CREATE INDEX Z_Keyword_byUuidIndex ON ZKEYWORD (ZUUID COLLATE BINARY ASC);
CREATE UNIQUE INDEX Z_Keyword_UNIQUE_title ON ZKEYWORD (ZTITLE COLLATE BINARY ASC);
CREATE INDEX ZLEGACYFACE_ZASSET_INDEX ON ZLEGACYFACE (ZASSET);
CREATE INDEX Z_LegacyFace_byAlbumUUIDIndex ON ZLEGACYFACE (ZALBUMUUID COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFace_byIdentifierIndex ON ZLEGACYFACE (ZIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX ZMEDIAANALYSISASSETATTRIBUTES_ZASSET_INDEX ON ZMEDIAANALYSISASSETATTRIBUTES (ZASSET);
CREATE INDEX ZMEMORY_ZKEYASSET_INDEX ON ZMEMORY (ZKEYASSET);
CREATE INDEX Z_Memory_byCloudLocalStateIndex ON ZMEMORY (ZCLOUDLOCALSTATE 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_byPendingIndex ON ZMEMORY (ZPENDING 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 ZMOMENT_ZHIGHLIGHT_INDEX ON ZMOMENT (ZHIGHLIGHT);
CREATE INDEX ZMOMENT_ZMEGAMOMENTLIST_INDEX ON ZMOMENT (ZMEGAMOMENTLIST);
CREATE INDEX ZMOMENT_ZYEARMOMENTLIST_INDEX ON ZMOMENT (ZYEARMOMENTLIST);
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_MomentList_byGranularityLevelIndex ON ZMOMENTLIST (ZGRANULARITYLEVEL COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_byRepresentativeDateIndex ON ZMOMENTLIST (ZREPRESENTATIVEDATE COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_bySortIndexIndex ON ZMOMENTLIST (ZSORTINDEX COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_byTrashedStateIndex ON ZMOMENTLIST (ZTRASHEDSTATE COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_byUuidIndex ON ZMOMENTLIST (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_compoundIndex ON ZMOMENTLIST (
ZGRANULARITYLEVEL COLLATE BINARY ASC,
ZSORTINDEX COLLATE BINARY ASC
);
CREATE INDEX Z_MomentShare_byShareURLIndex ON ZMOMENTSHARE (ZSHAREURL COLLATE BINARY ASC);
CREATE INDEX Z_MomentShare_byUuidIndex ON ZMOMENTSHARE (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_MomentShare_byCreationDate ON ZMOMENTSHARE (ZCREATIONDATE COLLATE BINARY DESC);
CREATE INDEX ZMOMENTSHAREPARTICIPANT_ZMOMENTSHARE_INDEX ON ZMOMENTSHAREPARTICIPANT (ZMOMENTSHARE);
CREATE INDEX Z_MomentShareParticipant_byUuidIndex ON ZMOMENTSHAREPARTICIPANT (ZUUID COLLATE BINARY ASC);
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 Z_45MERGECANDIDATES_REFLEXIVE_INDEX ON Z_45MERGECANDIDATES (REFLEXIVE, Z_45MERGECANDIDATES);
CREATE INDEX Z_45INVALIDMERGECANDIDATES_REFLEXIVE_INDEX ON Z_45INVALIDMERGECANDIDATES (REFLEXIVE, Z_45INVALIDMERGECANDIDATES);
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_byPersonUriIndex ON ZPERSON (ZPERSONURI COLLATE BINARY ASC);
CREATE INDEX Z_Person_byPersonUUIDIndex ON ZPERSON (ZPERSONUUID 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 ZPERSONREFERENCE_ZASSETATTRIBUTES_INDEX ON ZPERSONREFERENCE (ZASSETATTRIBUTES);
CREATE INDEX ZPERSONREFERENCE_ZPERSON_INDEX ON ZPERSONREFERENCE (ZPERSON);
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 Z_PhotosHighlight_byKindIndex ON ZPHOTOSHIGHLIGHT (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_PhotosHighlight_byUuidIndex ON ZPHOTOSHIGHLIGHT (ZUUID COLLATE BINARY ASC);
CREATE INDEX ZSCENECLASSIFICATION_ZASSETATTRIBUTES_INDEX ON ZSCENECLASSIFICATION (ZASSETATTRIBUTES);
CREATE INDEX Z_SceneClassification_bySceneIdentifierIndex ON ZSCENECLASSIFICATION (ZSCENEIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_SceneClassification_compoundIndex ON ZSCENECLASSIFICATION (
ZSCENEIDENTIFIER COLLATE BINARY ASC,
ZCONFIDENCE COLLATE BINARY ASC
);
CREATE INDEX ZSCENEPRINT_ZADDITIONALASSETATTRIBUTES_INDEX ON ZSCENEPRINT (ZADDITIONALASSETATTRIBUTES);
CREATE INDEX ZSEARCHDATA_ZASSET_INDEX ON ZSEARCHDATA (ZASSET);
CREATE INDEX Z_SearchData_byValidIndex ON ZSEARCHDATA (ZVALID COLLATE BINARY ASC);
CREATE INDEX Z_Suggestion_byStateIndex ON ZSUGGESTION (ZSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Suggestion_byCreationDate ON ZSUGGESTION (ZCREATIONDATE COLLATE BINARY DESC);
CREATE UNIQUE INDEX Z_UniformTypeIdentifier_UNIQUE_identifier ON ZUNIFORMTYPEIDENTIFIER (ZIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX ZUNMANAGEDADJUSTMENT_ZASSETATTRIBUTES_INDEX ON ZUNMANAGEDADJUSTMENT (ZASSETATTRIBUTES);
CREATE VIRTUAL TABLE Z_RT_GenericAsset_boundedByRect USING RTREE (
Z_PK INTEGER PRIMARY KEY,
ZLATITUDE_MIN FLOAT,
ZLATITUDE_MAX FLOAT,
ZLONGITUDE_MIN FLOAT,
ZLONGITUDE_MAX FLOAT
)
/* Z_RT_GenericAsset_boundedByRect(Z_PK,ZLATITUDE_MIN,ZLATITUDE_MAX,ZLONGITUDE_MIN,ZLONGITUDE_MAX) */
;
CREATE TABLE IF NOT EXISTS "Z_RT_GenericAsset_boundedByRect_rowid"(rowid INTEGER PRIMARY KEY, nodeno);
CREATE TABLE IF NOT EXISTS "Z_RT_GenericAsset_boundedByRect_node"(nodeno INTEGER PRIMARY KEY, data);
CREATE TABLE IF NOT EXISTS "Z_RT_GenericAsset_boundedByRect_parent"(nodeno INTEGER PRIMARY KEY, parentnode);
CREATE TRIGGER Z_RT_GenericAsset_boundedByRect_INSERT
AFTER
INSERT
ON ZGENERICASSET FOR EACH ROW BEGIN
INSERT
OR REPLACE INTO Z_RT_GenericAsset_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_GenericAsset_boundedByRect_UPDATE
AFTER
UPDATE
ON ZGENERICASSET FOR EACH ROW BEGIN
DELETE FROM
Z_RT_GenericAsset_boundedByRect
WHERE
Z_PK = NEW.Z_PK;
INSERT INTO
Z_RT_GenericAsset_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_GenericAsset_boundedByRect_DELETE
AFTER
DELETE ON ZGENERICASSET FOR EACH ROW BEGIN
DELETE FROM
Z_RT_GenericAsset_boundedByRect
WHERE
Z_PK = OLD.Z_PK;
END;
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 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
);
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 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 Z_TRANSACTION_TransactionAuthorIndex ON ATRANSACTION (ZAUTHOR COLLATE BINARY ASC);
CREATE INDEX Z_TRANSACTION_TransactionTimestampIndex ON ATRANSACTION (ZTIMESTAMP COLLATE BINARY ASC);
CREATE UNIQUE INDEX Z_TRANSACTIONSTRING_UNIQUE_NAME ON ATRANSACTIONSTRING (ZNAME 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);
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 RADAR_22158684_INDEX ON Z_26ASSETS (Z_26ALBUMS, Z_FOK_34ASSETS, Z_34ASSETS);
CREATE INDEX RADAR_10322662_INDEX ON Z_26ASSETS (Z_26ALBUMS, Z_34ASSETS, Z_FOK_34ASSETS);
CREATE UNIQUE INDEX RADAR_45737537_UNIQUE_INDEX ON ZINTERNALRESOURCE (
ZASSET,
ZRESOURCETYPE,
ZVERSION,
ZRECIPEID,
ZUNIFORMTYPEIDENTIFIER
);
CREATE INDEX Z_AdditionalAssetAttributes_cameraCaptureDevice ON ZADDITIONALASSETATTRIBUTES (ZCAMERACAPTUREDEVICE COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_originalHash ON ZADDITIONALASSETATTRIBUTES (ZORIGINALHASH COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_reverseLocationDataIsValid ON ZADDITIONALASSETATTRIBUTES (ZREVERSELOCATIONDATAISVALID COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_creatorBundleID ON ZADDITIONALASSETATTRIBUTES (ZCREATORBUNDLEID COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_originalAssetsUUID ON ZADDITIONALASSETATTRIBUTES (ZORIGINALASSETSUUID COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_locationHash ON ZADDITIONALASSETATTRIBUTES (ZLOCATIONHASH COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_allowedForAnalysis ON ZADDITIONALASSETATTRIBUTES (ZALLOWEDFORANALYSIS COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_uploadAttempts ON ZADDITIONALASSETATTRIBUTES (ZUPLOADATTEMPTS COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_publicGlobalUUID ON ZADDITIONALASSETATTRIBUTES (ZPUBLICGLOBALUUID COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_adjustedFingerPrint ON ZADDITIONALASSETATTRIBUTES (ZADJUSTEDFINGERPRINT COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_shiftedLocationIsValid ON ZADDITIONALASSETATTRIBUTES (ZSHIFTEDLOCATIONISVALID COLLATE BINARY ASC);
CREATE INDEX Z_AdditionalAssetAttributes_masterFingerPrint ON ZADDITIONALASSETATTRIBUTES (ZMASTERFINGERPRINT COLLATE BINARY ASC);
CREATE INDEX Z_AlbumList_identifier ON ZALBUMLIST (ZIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_AlbumList_uuid ON ZALBUMLIST (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_AssetAnalysisState_workerType ON ZASSETANALYSISSTATE (ZWORKERTYPE COLLATE BINARY ASC);
CREATE INDEX Z_AssetAnalysisState_sortToken ON ZASSETANALYSISSTATE (ZSORTTOKEN COLLATE BINARY ASC);
CREATE INDEX Z_CloudFeedEntry_entryDate ON ZCLOUDFEEDENTRY (ZENTRYDATE COLLATE BINARY ASC);
CREATE INDEX Z_CloudFeedEntry_entryTypeNumber ON ZCLOUDFEEDENTRY (ZENTRYTYPENUMBER COLLATE BINARY ASC);
CREATE INDEX Z_CloudMaster_cloudLocalState ON ZCLOUDMASTER (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_CloudMaster_cloudMasterGUID ON ZCLOUDMASTER (ZCLOUDMASTERGUID COLLATE BINARY ASC);
CREATE INDEX Z_CloudResource_assetUuid ON ZCLOUDRESOURCE (ZASSETUUID COLLATE BINARY ASC);
CREATE INDEX Z_CloudResource_isAvailable ON ZCLOUDRESOURCE (ZISAVAILABLE COLLATE BINARY ASC);
CREATE INDEX Z_CloudResource_isLocallyAvailable ON ZCLOUDRESOURCE (ZISLOCALLYAVAILABLE COLLATE BINARY ASC);
CREATE INDEX Z_CloudResource_dateCreated ON ZCLOUDRESOURCE (ZDATECREATED COLLATE BINARY ASC);
CREATE INDEX Z_CloudResource_type ON ZCLOUDRESOURCE (ZTYPE COLLATE BINARY ASC);
CREATE INDEX Z_CloudSharedComment_cloudGUID ON ZCLOUDSHAREDCOMMENT (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_DeferredRebuildFace_assetCloudGUID ON ZDEFERREDREBUILDFACE (ZASSETCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_DetectedFace_cloudLocalState ON ZDETECTEDFACE (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_DetectedFace_uuid ON ZDETECTEDFACE (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_DetectedFace_clusterSequenceNumber ON ZDETECTEDFACE (ZCLUSTERSEQUENCENUMBER COLLATE BINARY ASC);
CREATE INDEX Z_DetectedFaceGroup_personBuilderState ON ZDETECTEDFACEGROUP (ZPERSONBUILDERSTATE COLLATE BINARY ASC);
CREATE INDEX Z_FaceCrop_uuid ON ZFACECROP (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_FaceCrop_cloudLocalState ON ZFACECROP (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_FaceCrop_state ON ZFACECROP (ZSTATE COLLATE BINARY ASC);
CREATE INDEX Z_FileSystemVolume_volumeUuidString ON ZFILESYSTEMVOLUME (ZVOLUMEUUIDSTRING COLLATE BINARY ASC);
CREATE INDEX Z_FileSystemVolume_uuid ON ZFILESYSTEMVOLUME (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAlbum_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAlbum_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAlbum_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_GenericAlbum_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAlbum_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAlbum_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_InternalResource_cloudMasterDateCreated ON ZINTERNALRESOURCE (ZCLOUDMASTERDATECREATED COLLATE BINARY ASC);
CREATE INDEX Z_InternalResource_localAvailability ON ZINTERNALRESOURCE (ZLOCALAVAILABILITY COLLATE BINARY ASC);
CREATE INDEX Z_InternalResource_fileID ON ZINTERNALRESOURCE (ZFILEID COLLATE BINARY ASC);
CREATE INDEX Z_Keyword_title ON ZKEYWORD (ZTITLE COLLATE BINARY ASC);
CREATE INDEX Z_Keyword_uuid ON ZKEYWORD (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFace_albumUUID ON ZLEGACYFACE (ZALBUMUUID COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFace_identifier ON ZLEGACYFACE (ZIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_Memory_lastMoviePlayedDate ON ZMEMORY (ZLASTMOVIEPLAYEDDATE COLLATE BINARY ASC);
CREATE INDEX Z_Memory_pending ON ZMEMORY (ZPENDING COLLATE BINARY ASC);
CREATE INDEX Z_Memory_uuid ON ZMEMORY (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_Memory_cloudLocalState ON ZMEMORY (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Memory_lastViewedDate ON ZMEMORY (ZLASTVIEWEDDATE COLLATE BINARY ASC);
CREATE INDEX Z_Moment_trashedState ON ZMOMENT (ZTRASHEDSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Moment_uuid ON ZMOMENT (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_Moment_endDate ON ZMOMENT (ZENDDATE COLLATE BINARY ASC);
CREATE INDEX Z_Moment_representativeDate ON ZMOMENT (ZREPRESENTATIVEDATE COLLATE BINARY ASC);
CREATE INDEX Z_Moment_startDate ON ZMOMENT (ZSTARTDATE COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_sortIndex ON ZMOMENTLIST (ZSORTINDEX COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_uuid ON ZMOMENTLIST (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_granularityLevel ON ZMOMENTLIST (ZGRANULARITYLEVEL COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_representativeDate ON ZMOMENTLIST (ZREPRESENTATIVEDATE COLLATE BINARY ASC);
CREATE INDEX Z_MomentList_trashedState ON ZMOMENTLIST (ZTRASHEDSTATE COLLATE BINARY ASC);
CREATE INDEX Z_MomentShare_shareURL ON ZMOMENTSHARE (ZSHAREURL COLLATE BINARY ASC);
CREATE INDEX Z_MomentShare_uuid ON ZMOMENTSHARE (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_MomentShareParticipant_uuid ON ZMOMENTSHAREPARTICIPANT (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_Person_manualOrder ON ZPERSON (ZMANUALORDER COLLATE BINARY ASC);
CREATE INDEX Z_Person_cloudLocalState ON ZPERSON (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Person_verifiedType ON ZPERSON (ZVERIFIEDTYPE COLLATE BINARY ASC);
CREATE INDEX Z_Person_personUUID ON ZPERSON (ZPERSONUUID COLLATE BINARY ASC);
CREATE INDEX Z_Person_faceCount ON ZPERSON (ZFACECOUNT COLLATE BINARY ASC);
CREATE INDEX Z_Person_type ON ZPERSON (ZTYPE COLLATE BINARY ASC);
CREATE INDEX Z_Person_personUri ON ZPERSON (ZPERSONURI COLLATE BINARY ASC);
CREATE INDEX Z_PhotosHighlight_uuid ON ZPHOTOSHIGHLIGHT (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_PhotosHighlight_kind ON ZPHOTOSHIGHLIGHT (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_SceneClassification_sceneIdentifier ON ZSCENECLASSIFICATION (ZSCENEIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_SearchData_valid ON ZSEARCHDATA (ZVALID COLLATE BINARY ASC);
CREATE INDEX Z_Suggestion_state ON ZSUGGESTION (ZSTATE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byAddedDateIndex ON ZGENERICASSET (ZADDEDDATE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byAvalanchePickTypeIndex ON ZGENERICASSET (ZAVALANCHEPICKTYPE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byAvalancheUUIDIndex ON ZGENERICASSET (ZAVALANCHEUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byCloudAssetGUIDIndex ON ZGENERICASSET (ZCLOUDASSETGUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byCloudPlaceholderKindIndex ON ZGENERICASSET (ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byCompleteIndex ON ZGENERICASSET (ZCOMPLETE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byCustomRenderedValueIndex ON ZGENERICASSET (ZCUSTOMRENDEREDVALUE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byDateCreatedIndex ON ZGENERICASSET (ZDATECREATED COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byDepthStatesIndex ON ZGENERICASSET (ZDEPTHSTATES COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byFavoriteIndex ON ZGENERICASSET (ZFAVORITE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byGroupingUUIDIndex ON ZGENERICASSET (ZGROUPINGUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byKindIndex ON ZGENERICASSET (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byKindSubtypeIndex ON ZGENERICASSET (ZKINDSUBTYPE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byLastSharedDateIndex ON ZGENERICASSET (ZLASTSHAREDDATE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byMediaGroupUUIDIndex ON ZGENERICASSET (ZMEDIAGROUPUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byPlaybackStyleIndex ON ZGENERICASSET (ZPLAYBACKSTYLE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byPlaybackVariationIndex ON ZGENERICASSET (ZPLAYBACKVARIATION COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_bySavedAssetTypeIndex ON ZGENERICASSET (ZSAVEDASSETTYPE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_bySortTokenIndex ON ZGENERICASSET (ZSORTTOKEN COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byThumbnailIndexIndex ON ZGENERICASSET (ZTHUMBNAILINDEX COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byUniformTypeIdentifierIndex ON ZGENERICASSET (ZUNIFORMTYPEIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byUuidIndex ON ZGENERICASSET (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_byVisibilityStateIndex ON ZGENERICASSET (ZVISIBILITYSTATE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_compoundIndex ON ZGENERICASSET (
ZKIND COLLATE BINARY ASC,
Z_ENT COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex1 ON ZGENERICASSET (
ZCLOUDASSETGUID COLLATE BINARY ASC,
ZSAVEDASSETTYPE COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex2 ON ZGENERICASSET (
ZDIRECTORY COLLATE BINARY ASC,
ZFILENAME COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex3 ON ZGENERICASSET (
ZCLOUDLOCALSTATE COLLATE BINARY ASC,
ZDATECREATED COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex4 ON ZGENERICASSET (
ZHIDDEN COLLATE BINARY ASC,
ZVISIBILITYSTATE COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex5 ON ZGENERICASSET (
ZTRASHEDSTATE COLLATE BINARY ASC,
ZTRASHEDDATE COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex6 ON ZGENERICASSET (
ZADDEDDATE COLLATE BINARY ASC,
ZSORTTOKEN COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex7 ON ZGENERICASSET (
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,
Z_ENT COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex8 ON ZGENERICASSET (
ZTRASHEDSTATE COLLATE BINARY ASC,
ZCLOUDLOCALSTATE COLLATE BINARY ASC,
ZSAVEDASSETTYPE COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex9 ON ZGENERICASSET (
ZKIND COLLATE BINARY ASC,
ZTRASHEDSTATE COLLATE BINARY ASC,
ZCLOUDLOCALSTATE COLLATE BINARY ASC,
ZSAVEDASSETTYPE COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex10 ON ZGENERICASSET (
ZFAVORITE COLLATE BINARY ASC,
ZDATECREATED COLLATE BINARY ASC,
ZADDEDDATE COLLATE BINARY ASC,
ZFILENAME 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
);
CREATE INDEX Z_GenericAsset_compoundIndex11 ON ZGENERICASSET (
ZPLAYBACKSTYLE COLLATE BINARY ASC,
ZDATECREATED COLLATE BINARY ASC,
ZADDEDDATE COLLATE BINARY ASC,
ZFILENAME 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
);
CREATE INDEX Z_GenericAsset_compoundIndex12 ON ZGENERICASSET (
ZLATITUDE COLLATE BINARY ASC,
ZLONGITUDE COLLATE BINARY ASC,
ZTRASHEDSTATE COLLATE BINARY ASC,
ZHIDDEN COLLATE BINARY ASC,
ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
ZSAVEDASSETTYPE COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex13 ON ZGENERICASSET (
ZKINDSUBTYPE COLLATE BINARY ASC,
ZDATECREATED COLLATE BINARY ASC,
ZADDEDDATE COLLATE BINARY ASC,
ZFILENAME COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex14 ON ZGENERICASSET (
ZSAVEDASSETTYPE COLLATE BINARY ASC,
ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC,
ZCLOUDSERVERPUBLISHDATE COLLATE BINARY ASC,
ZCLOUDBATCHPUBLISHDATE COLLATE BINARY ASC,
ZDATECREATED COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex15 ON ZGENERICASSET (
ZSAVEDASSETTYPE COLLATE BINARY ASC,
ZVISIBILITYSTATE COLLATE BINARY ASC,
ZHIDDEN COLLATE BINARY ASC,
ZTRASHEDSTATE COLLATE BINARY ASC,
ZLOCATIONDATA COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex16 ON ZGENERICASSET (
ZIMPORTSESSION COLLATE BINARY ASC,
ZSAVEDASSETTYPE COLLATE BINARY ASC,
ZVISIBILITYSTATE COLLATE BINARY ASC,
ZHIDDEN COLLATE BINARY ASC,
ZTRASHEDSTATE COLLATE BINARY ASC,
ZAVALANCHEPICKTYPE COLLATE BINARY ASC,
Z_ENT COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex17 ON ZGENERICASSET (
ZCLOUDHASUNSEENCOMMENTS COLLATE BINARY ASC,
ZSAVEDASSETTYPE COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_forAllPhotos ON ZGENERICASSET (
ZDATECREATED COLLATE BINARY ASC,
ZADDEDDATE COLLATE BINARY ASC,
ZFILENAME 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,
Z_ENT COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_byMonthHighlightBeingFirstAsset ON ZGENERICASSET (
ZDATECREATED COLLATE BINARY ASC,
ZMONTHHIGHLIGHTBEINGFIRSTASSET COLLATE BINARY ASC,
Z_ENT COLLATE BINARY ASC
)
WHERE
ZMONTHHIGHLIGHTBEINGFIRSTASSET IS NOT NULL;
CREATE INDEX Z_GenericAsset_forThumbnailAsset ON ZGENERICASSET (
ZTHUMBNAILINDEX COLLATE BINARY ASC,
ZCOMPLETE COLLATE BINARY ASC,
ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC,
Z_ENT COLLATE BINARY ASC
);
CREATE INDEX Z_GenericAsset_compoundIndex19 ON ZGENERICASSET (
ZDEFERREDPROCESSINGNEEDED COLLATE BINARY ASC,
ZKIND COLLATE BINARY ASC
);
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 INDEX Z_CloudFeedAssetsEntry_entryDate ON ZCLOUDFEEDENTRY (ZENTRYDATE COLLATE BINARY ASC);
CREATE INDEX Z_CloudFeedAssetsEntry_entryTypeNumber ON ZCLOUDFEEDENTRY (ZENTRYTYPENUMBER COLLATE BINARY ASC);
CREATE INDEX Z_CloudFeedCommentsEntry_entryDate ON ZCLOUDFEEDENTRY (ZENTRYDATE COLLATE BINARY ASC);
CREATE INDEX Z_CloudFeedCommentsEntry_entryTypeNumber ON ZCLOUDFEEDENTRY (ZENTRYTYPENUMBER COLLATE BINARY ASC);
CREATE INDEX Z_Album_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_Album_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Album_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_Album_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_Album_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_Album_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_CloudSharedAlbum_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_CloudSharedAlbum_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_CloudSharedAlbum_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_CloudSharedAlbum_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_CloudSharedAlbum_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_CloudSharedAlbum_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFaceAlbum_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFaceAlbum_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFaceAlbum_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFaceAlbum_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFaceAlbum_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_LegacyFaceAlbum_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_PhotoStreamAlbum_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_PhotoStreamAlbum_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_PhotoStreamAlbum_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_PhotoStreamAlbum_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_PhotoStreamAlbum_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_PhotoStreamAlbum_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_ProjectAlbum_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_ProjectAlbum_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_ProjectAlbum_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_ProjectAlbum_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_ProjectAlbum_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_ProjectAlbum_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_FetchingAlbum_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_FetchingAlbum_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_FetchingAlbum_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_FetchingAlbum_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_FetchingAlbum_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_FetchingAlbum_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_Folder_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_Folder_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Folder_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_Folder_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_Folder_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_Folder_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_ImportSession_cloudGUID ON ZGENERICALBUM (ZCLOUDGUID COLLATE BINARY ASC);
CREATE INDEX Z_ImportSession_cloudLocalState ON ZGENERICALBUM (ZCLOUDLOCALSTATE COLLATE BINARY ASC);
CREATE INDEX Z_ImportSession_importSessionID ON ZGENERICALBUM (ZIMPORTSESSIONID COLLATE BINARY ASC);
CREATE INDEX Z_ImportSession_kind ON ZGENERICALBUM (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_ImportSession_syncEventOrderKey ON ZGENERICALBUM (ZSYNCEVENTORDERKEY COLLATE BINARY ASC);
CREATE INDEX Z_ImportSession_uuid ON ZGENERICALBUM (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_34SUGGESTIONSBEINGREPRESENTATIVEASSETS_Z_52SUGGESTIONSBEINGREPRESENTATIVEASSETS_INDEX ON Z_34SUGGESTIONSBEINGREPRESENTATIVEASSETS (
Z_52SUGGESTIONSBEINGREPRESENTATIVEASSETS,
Z_34REPRESENTATIVEASSETS1
);
CREATE INDEX Z_34SUGGESTIONSBEINGKEYASSETS_Z_52SUGGESTIONSBEINGKEYASSETS_INDEX ON Z_34SUGGESTIONSBEINGKEYASSETS (Z_52SUGGESTIONSBEINGKEYASSETS, Z_34KEYASSETS);
CREATE INDEX Z_GenericAsset_addedDate ON ZGENERICASSET (ZADDEDDATE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_avalanchePickType ON ZGENERICASSET (ZAVALANCHEPICKTYPE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_avalancheUUID ON ZGENERICASSET (ZAVALANCHEUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_cloudAssetGUID ON ZGENERICASSET (ZCLOUDASSETGUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_cloudPlaceholderKind ON ZGENERICASSET (ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_complete ON ZGENERICASSET (ZCOMPLETE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_customRenderedValue ON ZGENERICASSET (ZCUSTOMRENDEREDVALUE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_dateCreated ON ZGENERICASSET (ZDATECREATED COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_depthStates ON ZGENERICASSET (ZDEPTHSTATES COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_favorite ON ZGENERICASSET (ZFAVORITE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_groupingUUID ON ZGENERICASSET (ZGROUPINGUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_kind ON ZGENERICASSET (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_kindSubtype ON ZGENERICASSET (ZKINDSUBTYPE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_lastSharedDate ON ZGENERICASSET (ZLASTSHAREDDATE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_mediaGroupUUID ON ZGENERICASSET (ZMEDIAGROUPUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_playbackStyle ON ZGENERICASSET (ZPLAYBACKSTYLE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_playbackVariation ON ZGENERICASSET (ZPLAYBACKVARIATION COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_savedAssetType ON ZGENERICASSET (ZSAVEDASSETTYPE COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_sortToken ON ZGENERICASSET (ZSORTTOKEN COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_thumbnailIndex ON ZGENERICASSET (ZTHUMBNAILINDEX COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_uniformTypeIdentifier ON ZGENERICASSET (ZUNIFORMTYPEIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_uuid ON ZGENERICASSET (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_GenericAsset_visibilityState ON ZGENERICASSET (ZVISIBILITYSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_addedDate ON ZGENERICASSET (ZADDEDDATE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_avalanchePickType ON ZGENERICASSET (ZAVALANCHEPICKTYPE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_avalancheUUID ON ZGENERICASSET (ZAVALANCHEUUID COLLATE BINARY ASC);
CREATE INDEX Z_Asset_cloudAssetGUID ON ZGENERICASSET (ZCLOUDASSETGUID COLLATE BINARY ASC);
CREATE INDEX Z_Asset_cloudPlaceholderKind ON ZGENERICASSET (ZCLOUDPLACEHOLDERKIND COLLATE BINARY ASC);
CREATE INDEX Z_Asset_complete ON ZGENERICASSET (ZCOMPLETE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_customRenderedValue ON ZGENERICASSET (ZCUSTOMRENDEREDVALUE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_dateCreated ON ZGENERICASSET (ZDATECREATED COLLATE BINARY ASC);
CREATE INDEX Z_Asset_depthStates ON ZGENERICASSET (ZDEPTHSTATES COLLATE BINARY ASC);
CREATE INDEX Z_Asset_favorite ON ZGENERICASSET (ZFAVORITE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_groupingUUID ON ZGENERICASSET (ZGROUPINGUUID COLLATE BINARY ASC);
CREATE INDEX Z_Asset_kind ON ZGENERICASSET (ZKIND COLLATE BINARY ASC);
CREATE INDEX Z_Asset_kindSubtype ON ZGENERICASSET (ZKINDSUBTYPE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_lastSharedDate ON ZGENERICASSET (ZLASTSHAREDDATE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_mediaGroupUUID ON ZGENERICASSET (ZMEDIAGROUPUUID COLLATE BINARY ASC);
CREATE INDEX Z_Asset_playbackStyle ON ZGENERICASSET (ZPLAYBACKSTYLE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_playbackVariation ON ZGENERICASSET (ZPLAYBACKVARIATION COLLATE BINARY ASC);
CREATE INDEX Z_Asset_savedAssetType ON ZGENERICASSET (ZSAVEDASSETTYPE COLLATE BINARY ASC);
CREATE INDEX Z_Asset_sortToken ON ZGENERICASSET (ZSORTTOKEN COLLATE BINARY ASC);
CREATE INDEX Z_Asset_thumbnailIndex ON ZGENERICASSET (ZTHUMBNAILINDEX COLLATE BINARY ASC);
CREATE INDEX Z_Asset_uniformTypeIdentifier ON ZGENERICASSET (ZUNIFORMTYPEIDENTIFIER COLLATE BINARY ASC);
CREATE INDEX Z_Asset_uuid ON ZGENERICASSET (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_Asset_visibilityState ON ZGENERICASSET (ZVISIBILITYSTATE COLLATE BINARY ASC);
CREATE INDEX Z_Question_uuid ON ZQUESTION (ZUUID COLLATE BINARY ASC);
CREATE INDEX Z_Question_byUuidIndex ON ZQUESTION (ZUUID COLLATE BINARY ASC);
CREATE TABLE Z_PRIMARYKEY (
Z_ENT INTEGER PRIMARY KEY,
Z_NAME VARCHAR,
Z_SUPER INTEGER,
Z_MAX INTEGER
);
CREATE TRIGGER ZT_ZDETECTEDFACE_ZASSETVISIBLE_ZGENERICASSET_INSERT_INCREMENT
AFTER
INSERT
ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_INCREMENT
AFTER
UPDATE
OF ZTRASHEDSTATE,
ZVISIBILITYSTATE,
ZHIDDEN ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_DECREMENT
AFTER
UPDATE
OF ZTRASHEDSTATE,
ZVISIBILITYSTATE,
ZHIDDEN ON ZGENERICASSET 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_ZGENERICASSET_DELETE_DECREMENT
AFTER
DELETE ON ZGENERICASSET 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_ZGENERICASSET_ZDETECTEDFACE_INSERT_INCREMENT
AFTER
INSERT
ON ZDETECTEDFACE FOR EACH ROW BEGIN
UPDATE
ZDETECTEDFACE
SET
ZASSETVISIBLE = (
SELECT
COUNT(Z_PK)
FROM
ZGENERICASSET
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_ZGENERICASSET_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_ZGENERICASSET_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
ZGENERICASSET
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_INSERT_INCREMENT
AFTER
INSERT
ON ZDETECTEDFACE FOR EACH ROW
WHEN NEW.ZHIDDEN == 0
AND NEW.ZASSETVISIBLE == 1 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_INCREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZASSETVISIBLE ON ZDETECTEDFACE FOR EACH ROW
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZASSETVISIBLE == 1
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZASSETVISIBLE != OLD.ZASSETVISIBLE
)
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_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZASSETVISIBLE ON ZDETECTEDFACE FOR EACH ROW
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZASSETVISIBLE == 1
)
AND (
NEW.ZHIDDEN != OLD.ZHIDDEN
OR NEW.ZASSETVISIBLE != OLD.ZASSETVISIBLE
)
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_DELETE_DECREMENT
AFTER
DELETE ON ZDETECTEDFACE FOR EACH ROW
WHEN OLD.ZHIDDEN == 0
AND OLD.ZASSETVISIBLE == 1 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_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
)
)
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_INCREMENT
AFTER
UPDATE
OF ZPERSON ON ZDETECTEDFACE
WHEN (
NEW.ZHIDDEN == 0
AND NEW.ZASSETVISIBLE == 1
)
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_ZPERSON_ZFACECOUNT_ZDETECTEDFACE_ZPERSON_UPDATE_DECREMENT
AFTER
UPDATE
OF ZPERSON ON ZDETECTEDFACE
WHEN (
OLD.ZHIDDEN == 0
AND OLD.ZASSETVISIBLE == 1
)
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_ZPHOTOSHIGHLIGHT_ZASSETSCOUNT_ZGENERICASSET_INSERT_INCREMENT
AFTER
INSERT
ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_DELETE_DECREMENT
AFTER
DELETE ON ZGENERICASSET 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_ZGENERICASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT
ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE
ZPHOTOSHIGHLIGHT
SET
ZASSETSCOUNT = (
SELECT
COUNT(Z_PK)
FROM
ZGENERICASSET
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_ZASSETSCOUNT_ZGENERICASSET_ZHIGHLIGHTBEINGASSETS_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIGHLIGHTBEINGASSETS ON ZGENERICASSET
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_ZGENERICASSET_ZHIGHLIGHTBEINGASSETS_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIGHLIGHTBEINGASSETS ON ZGENERICASSET
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_ZDAYGROUPASSETSCOUNT_ZGENERICASSET_INSERT_INCREMENT
AFTER
INSERT
ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_DELETE_DECREMENT
AFTER
DELETE ON ZGENERICASSET 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_ZGENERICASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT
ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE
ZPHOTOSHIGHLIGHT
SET
ZDAYGROUPASSETSCOUNT = (
SELECT
COUNT(Z_PK)
FROM
ZGENERICASSET
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_ZDAYGROUPASSETSCOUNT_ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGASSETS_UPDATE_INCREMENT
AFTER
UPDATE
OF ZDAYGROUPHIGHLIGHTBEINGASSETS ON ZGENERICASSET
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_ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGASSETS_UPDATE_DECREMENT
AFTER
UPDATE
OF ZDAYGROUPHIGHLIGHTBEINGASSETS ON ZGENERICASSET
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_ZSUMMARYCOUNT_ZGENERICASSET_INSERT_INCREMENT
AFTER
INSERT
ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_DELETE_DECREMENT
AFTER
DELETE ON ZGENERICASSET 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_ZGENERICASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT
ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE
ZPHOTOSHIGHLIGHT
SET
ZSUMMARYCOUNT = (
SELECT
COUNT(Z_PK)
FROM
ZGENERICASSET
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 ZT_ZPHOTOSHIGHLIGHT_ZSUMMARYCOUNT_ZGENERICASSET_ZHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIGHLIGHTBEINGSUMMARYASSETS ON ZGENERICASSET
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_ZGENERICASSET_ZHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIGHLIGHTBEINGSUMMARYASSETS ON ZGENERICASSET
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_ZDAYGROUPSUMMARYASSETSCOUNT_ZGENERICASSET_INSERT_INCREMENT
AFTER
INSERT
ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_DELETE_DECREMENT
AFTER
DELETE ON ZGENERICASSET 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_ZGENERICASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT
ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE
ZPHOTOSHIGHLIGHT
SET
ZDAYGROUPSUMMARYASSETSCOUNT = (
SELECT
COUNT(Z_PK)
FROM
ZGENERICASSET
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_ZDAYGROUPSUMMARYASSETSCOUNT_ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_INCREMENT
AFTER
UPDATE
OF ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS ON ZGENERICASSET
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_ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS_UPDATE_DECREMENT
AFTER
UPDATE
OF ZDAYGROUPHIGHLIGHTBEINGSUMMARYASSETS ON ZGENERICASSET
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_ZDAYGROUPEXTENDEDASSETSCOUNT_ZGENERICASSET_INSERT_INCREMENT
AFTER
INSERT
ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_DELETE_DECREMENT
AFTER
DELETE ON ZGENERICASSET 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_ZGENERICASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT
ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE
ZPHOTOSHIGHLIGHT
SET
ZDAYGROUPEXTENDEDASSETSCOUNT = (
SELECT
COUNT(Z_PK)
FROM
ZGENERICASSET
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_ZDAYGROUPEXTENDEDASSETSCOUNT_ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_INCREMENT
AFTER
UPDATE
OF ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS ON ZGENERICASSET
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_ZGENERICASSET_ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_DECREMENT
AFTER
UPDATE
OF ZDAYGROUPHIGHLIGHTBEINGEXTENDEDASSETS ON ZGENERICASSET
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_ZEXTENDEDCOUNT_ZGENERICASSET_INSERT_INCREMENT
AFTER
INSERT
ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIDDEN,
ZTRASHEDSTATE ON ZGENERICASSET 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_ZGENERICASSET_DELETE_DECREMENT
AFTER
DELETE ON ZGENERICASSET 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_ZGENERICASSET_ZPHOTOSHIGHLIGHT_INSERT_INCREMENT
AFTER
INSERT
ON ZPHOTOSHIGHLIGHT FOR EACH ROW BEGIN
UPDATE
ZPHOTOSHIGHLIGHT
SET
ZEXTENDEDCOUNT = (
SELECT
COUNT(Z_PK)
FROM
ZGENERICASSET
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_ZEXTENDEDCOUNT_ZGENERICASSET_ZHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_INCREMENT
AFTER
UPDATE
OF ZHIGHLIGHTBEINGEXTENDEDASSETS ON ZGENERICASSET
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_ZGENERICASSET_ZHIGHLIGHTBEINGEXTENDEDASSETS_UPDATE_DECREMENT
AFTER
UPDATE
OF ZHIGHLIGHTBEINGEXTENDEDASSETS ON ZGENERICASSET
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;