Skip to content

iPhoto database schema

Rhet Turnbull edited this page Aug 10, 2020 · 1 revision

iPhoto uses several database located in Database/apdb

Library.apdb seems to contain most of the data

CREATE TABLE RKImportGroup (modelId integer primary key, uuid varchar, importYear varchar, importMonth varchar, importDay varchar, importTime varchar, name varchar);
CREATE INDEX RKImportGroup_uuid_index on RKImportGroup(uuid);
CREATE INDEX RKImportGroup_name_index on RKImportGroup(name);
CREATE TABLE RKKeyword (modelId integer primary key, uuid varchar, name varchar, searchName varchar, parentId integer, hasChildren integer, shortcut varchar);
CREATE INDEX RKKeyword_uuid_index on RKKeyword(uuid);
CREATE INDEX RKKeyword_name_index on RKKeyword(name);
CREATE INDEX RKKeyword_searchName_index on RKKeyword(searchName);
CREATE INDEX RKKeyword_parentId_index on RKKeyword(parentId);
CREATE TABLE RKAlbumVersion (modelId integer primary key, versionId integer, albumId integer);
CREATE INDEX RKAlbumVersion_versionId_index on RKAlbumVersion(versionId);
CREATE INDEX RKAlbumVersion_albumId_versionId_index on RKAlbumVersion(albumId,versionId);
CREATE TABLE RKAlbumVersion_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKAlbumVersion_RidIndexes_indexName_value_index on RKAlbumVersion_RidIndexes(indexName,value);
CREATE TABLE RKVersion (modelId integer primary key, uuid varchar, name varchar, fileName varchar, versionNumber integer, stackUuid varchar, masterUuid varchar, masterId integer, rawMasterUuid varchar, nonRawMasterUuid varchar, projectUuid varchar, imageTimeZoneName varchar, imageDate timestamp, mainRating integer, isHidden integer, isFlagged integer, isOriginal integer, isEditable integer, colorLabelIndex integer, masterHeight integer, masterWidth integer, processedHeight integer, processedWidth integer, rotation integer, hasAdjustments integer, hasEnabledAdjustments integer, hasNotes integer, createDate timestamp, exportImageChangeDate timestamp, exportMetadataChangeDate timestamp, isInTrash integer, thumbnailGroup varchar, overridePlaceId integer, exifLatitude decimal, exifLongitude decimal, renderVersion integer, adjSeqNum integer, supportedStatus integer, videoInPoint varchar, videoOutPoint varchar, videoPosterFramePoint varchar, showInLibrary integer, editState integer, contentVersion integer, propertiesVersion integer, rawVersion varchar, faceDetectionIsFromPreview integer, faceDetectionRotationFromMaster integer, editListData blob, hasKeywords integer);
CREATE INDEX RKVersion_uuid_index on RKVersion(uuid);
CREATE INDEX RKVersion_stackUuid_index on RKVersion(stackUuid);
CREATE INDEX RKVersion_masterUuid_index on RKVersion(masterUuid);
CREATE INDEX RKVersion_masterId_index on RKVersion(masterId);
CREATE INDEX RKVersion_rawMasterUuid_index on RKVersion(rawMasterUuid);
CREATE INDEX RKVersion_nonRawMasterUuid_index on RKVersion(nonRawMasterUuid);
CREATE INDEX RKVersion_isHidden_index on RKVersion(isHidden);
CREATE INDEX RKVersion_colorLabelIndex_index on RKVersion(colorLabelIndex);
CREATE INDEX RKVersion_hasEnabledAdjustments_index on RKVersion(hasEnabledAdjustments);
CREATE INDEX RKVersion_createDate_index on RKVersion(createDate);
CREATE INDEX RKVersion_isInTrash_index on RKVersion(isInTrash);
CREATE INDEX RKVersion_projectUuid_imageDate_index on RKVersion(projectUuid,imageDate);
CREATE TABLE RKVersion_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKVersion_RidIndexes_indexName_value_index on RKVersion_RidIndexes(indexName,value);
CREATE TABLE RKStackState (modelId integer primary key, stackUuid varchar, albumUuid varchar, albumPick varchar, isExpanded integer);
CREATE INDEX RKStackState_stackUuid_index on RKStackState(stackUuid);
CREATE INDEX RKStackState_albumUuid_index on RKStackState(albumUuid);
CREATE INDEX RKStackState_albumUuid_stackUuid_index on RKStackState(albumUuid,stackUuid);
CREATE TABLE RKStackContent (modelId integer primary key, stackUuid varchar, versionUuid varchar, orderNumber integer);
CREATE INDEX RKStackContent_stackUuid_index on RKStackContent(stackUuid);
CREATE INDEX RKStackContent_versionUuid_index on RKStackContent(versionUuid);
CREATE INDEX RKStackContent_orderNumber_index on RKStackContent(orderNumber);
CREATE TABLE RKKeywordForVersion (modelId integer primary key, versionId integer, keywordId integer);
CREATE INDEX RKKeywordForVersion_versionId_index on RKKeywordForVersion(versionId);
CREATE INDEX RKKeywordForVersion_keywordId_versionId_index on RKKeywordForVersion(keywordId,versionId);
CREATE TABLE RKPropertySet (modelId integer primary key, propertyArea varchar, propertyName varchar, propertyValue varchar);
CREATE INDEX RKPropertySet_propertyArea_index on RKPropertySet(propertyArea);
CREATE INDEX RKPropertySet_propertyValue_index on RKPropertySet(propertyValue);
CREATE UNIQUE INDEX RKPropertySet_propertyName_propertyArea_propertyValue_index on RKPropertySet(propertyName,propertyArea,propertyValue);
CREATE TABLE RKNote (modelId integer primary key, uuid varchar, attachedToClassType integer, attachedToUuid varchar, propertyKey varchar, note varchar, createDate timestamp, data blob);
CREATE INDEX RKNote_uuid_index on RKNote(uuid);
CREATE INDEX RKNote_attachedToUuid_index on RKNote(attachedToUuid);
CREATE INDEX RKNote_propertyKey_index on RKNote(propertyKey);
CREATE TABLE RKMaster (modelId integer primary key, uuid varchar, name varchar, projectUuid varchar, importGroupUuid varchar, fileVolumeUuid varchar, alternateMasterUuid varchar, originalVersionUuid varchar, originalVersionName varchar, fileName varchar, type varchar, subtype varchar, fileIsReference integer, isExternallyEditable integer, isTrulyRaw integer, isMissing integer, hasAttachments integer, hasNotes integer, hasFocusPoints integer, imagePath varchar, fileSize integer, pixelFormat integer, duration decimal, imageDate timestamp, fileCreationDate timestamp, fileModificationDate timestamp, streamAssetId varchar, streamSourceUuid varchar, burstUuid varchar, imageHash varchar, originalFileName varchar, originalFileSize integer, imageFormat integer, importedBy integer, createDate timestamp, isInTrash integer, faceDetectionState integer, colorSpaceName varchar, colorSpaceDefinition blob, fileAliasData blob);
CREATE INDEX RKMaster_uuid_index on RKMaster(uuid);
CREATE INDEX RKMaster_projectUuid_index on RKMaster(projectUuid);
CREATE INDEX RKMaster_importGroupUuid_index on RKMaster(importGroupUuid);
CREATE INDEX RKMaster_fileVolumeUuid_index on RKMaster(fileVolumeUuid);
CREATE INDEX RKMaster_alternateMasterUuid_index on RKMaster(alternateMasterUuid);
CREATE INDEX RKMaster_fileName_index on RKMaster(fileName);
CREATE INDEX RKMaster_type_index on RKMaster(type);
CREATE INDEX RKMaster_fileIsReference_index on RKMaster(fileIsReference);
CREATE INDEX RKMaster_isExternallyEditable_index on RKMaster(isExternallyEditable);
CREATE INDEX RKMaster_fileSize_index on RKMaster(fileSize);
CREATE INDEX RKMaster_fileCreationDate_index on RKMaster(fileCreationDate);
CREATE INDEX RKMaster_fileModificationDate_index on RKMaster(fileModificationDate);
CREATE INDEX RKMaster_streamAssetId_index on RKMaster(streamAssetId);
CREATE INDEX RKMaster_streamSourceUuid_index on RKMaster(streamSourceUuid);
CREATE INDEX RKMaster_burstUuid_index on RKMaster(burstUuid);
CREATE INDEX RKMaster_originalFileName_index on RKMaster(originalFileName);
CREATE INDEX RKMaster_originalFileSize_index on RKMaster(originalFileSize);
CREATE INDEX RKMaster_imageFormat_index on RKMaster(imageFormat);
CREATE INDEX RKMaster_createDate_index on RKMaster(createDate);
CREATE INDEX RKMaster_isInTrash_index on RKMaster(isInTrash);
CREATE INDEX RKMaster_faceDetectionState_index on RKMaster(faceDetectionState);
CREATE TABLE RKMaster_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKMaster_RidIndexes_indexName_value_index on RKMaster_RidIndexes(indexName,value);
CREATE TABLE RKAdminData (modelId integer primary key, propertyArea varchar, propertyName varchar, propertyValue varchar, blobPropertyValue blob, storedDataType integer, persistAfterRebuild integer);
CREATE INDEX RKAdminData_propertyArea_index on RKAdminData(propertyArea);
CREATE INDEX RKAdminData_persistAfterRebuild_index on RKAdminData(persistAfterRebuild);
CREATE UNIQUE INDEX RKAdminData_propertyName_propertyArea_index on RKAdminData(propertyName,propertyArea);
CREATE TABLE RKCustomSortOrder (modelId integer primary key, containerUuid varchar, purpose varchar, objectUuid varchar, orderNumber integer);
CREATE INDEX RKCustomSortOrder_containerUuid_index on RKCustomSortOrder(containerUuid);
CREATE INDEX RKCustomSortOrder_objectUuid_index on RKCustomSortOrder(objectUuid);
CREATE INDEX RKCustomSortOrder_purpose_containerUuid_index on RKCustomSortOrder(purpose,containerUuid);
CREATE TABLE RKFolder (modelId integer primary key, uuid varchar, folderType integer, name varchar, parentFolderUuid varchar, implicitAlbumUuid varchar, posterVersionUuid varchar, automaticallyGenerateFullSizePreviews integer, versionCount integer, minImageTimeZoneName varchar, maxImageTimeZoneName varchar, minImageDate timestamp, maxImageDate timestamp, folderPath varchar, createDate timestamp, isExpanded integer, isHidden integer, isHiddenWhenEmpty integer, isFavorite integer, isInTrash integer, isMagic integer, colorLabelIndex integer, sortAscending integer, sortKeyPath varchar);
CREATE INDEX RKFolder_uuid_index on RKFolder(uuid);
CREATE INDEX RKFolder_folderType_index on RKFolder(folderType);
CREATE INDEX RKFolder_parentFolderUuid_index on RKFolder(parentFolderUuid);
CREATE INDEX RKFolder_folderPath_index on RKFolder(folderPath);
CREATE INDEX RKFolder_createDate_index on RKFolder(createDate);
CREATE INDEX RKFolder_isInTrash_index on RKFolder(isInTrash);
CREATE INDEX RKFolder_isMagic_index on RKFolder(isMagic);
CREATE INDEX RKFolder_name_parentFolderUuid_index on RKFolder(name,parentFolderUuid);
CREATE TABLE RKFolder_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKFolder_RidIndexes_indexName_value_index on RKFolder_RidIndexes(indexName,value);
CREATE TABLE RKVolume (modelId integer primary key, uuid varchar, name varchar, diskUuid varchar, label varchar, isOffline integer, createDate timestamp, modDate timestamp);
CREATE INDEX RKVolume_uuid_index on RKVolume(uuid);
CREATE INDEX RKVolume_name_index on RKVolume(name);
CREATE INDEX RKVolume_diskUuid_index on RKVolume(diskUuid);
CREATE INDEX RKVolume_createDate_index on RKVolume(createDate);
CREATE INDEX RKVolume_modDate_index on RKVolume(modDate);
CREATE TABLE RKMasterGroup (modelId integer primary key, uuid varchar, relationshipType integer);
CREATE INDEX RKMasterGroup_uuid_index on RKMasterGroup(uuid);
CREATE INDEX RKMasterGroup_relationshipType_index on RKMasterGroup(relationshipType);
CREATE TABLE RKAttachment (modelId integer primary key, uuid varchar, attachedToClassType integer, attachedToUuid varchar, fileVolumeUuid varchar, propertyKey varchar, filename varchar, fileIsReference integer, isMissing integer, isInTrash integer, duration decimal, fileModificationDate timestamp, filePath varchar, fileAliasData blob, propertiesData blob);
CREATE INDEX RKAttachment_uuid_index on RKAttachment(uuid);
CREATE INDEX RKAttachment_attachedToUuid_index on RKAttachment(attachedToUuid);
CREATE INDEX RKAttachment_fileVolumeUuid_index on RKAttachment(fileVolumeUuid);
CREATE INDEX RKAttachment_propertyKey_index on RKAttachment(propertyKey);
CREATE INDEX RKAttachment_filename_index on RKAttachment(filename);
CREATE INDEX RKAttachment_fileIsReference_index on RKAttachment(fileIsReference);
CREATE INDEX RKAttachment_isInTrash_index on RKAttachment(isInTrash);
CREATE TABLE RKImageAdjustment (modelId integer primary key, uuid varchar, name varchar, versionUuid varchar, maskUuid varchar, adjIndex integer, isEnabled integer, data blob, dbVersion integer);
CREATE INDEX RKImageAdjustment_uuid_index on RKImageAdjustment(uuid);
CREATE INDEX RKImageAdjustment_name_index on RKImageAdjustment(name);
CREATE INDEX RKImageAdjustment_versionUuid_index on RKImageAdjustment(versionUuid);
CREATE INDEX RKImageAdjustment_maskUuid_index on RKImageAdjustment(maskUuid);
CREATE INDEX RKImageAdjustment_isEnabled_index on RKImageAdjustment(isEnabled);
CREATE TABLE RKVersionFaceContent (modelId integer primary key, versionId integer, masterId integer, isNamed integer, faceKey integer, faceIndex integer, faceRectLeft decimal, faceRectTop decimal, faceRectWidth decimal, faceRectHeight decimal);
CREATE INDEX RKVersionFaceContent_versionId_index on RKVersionFaceContent(versionId);
CREATE INDEX RKVersionFaceContent_isNamed_index on RKVersionFaceContent(isNamed);
CREATE INDEX RKVersionFaceContent_faceKey_index on RKVersionFaceContent(faceKey);
CREATE TABLE RKGroupsForVersions (modelId integer primary key, groupId integer, versionId integer, versionUuid varchar, relationshipType integer);
CREATE INDEX RKGroupsForVersions_groupId_index on RKGroupsForVersions(groupId);
CREATE INDEX RKGroupsForVersions_versionId_index on RKGroupsForVersions(versionId);
CREATE INDEX RKGroupsForVersions_versionUuid_index on RKGroupsForVersions(versionUuid);
CREATE INDEX RKGroupsForVersions_relationshipType_index on RKGroupsForVersions(relationshipType);
CREATE TABLE RKGroupsForVersions_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKGroupsForVersions_RidIndexes_indexName_value_index on RKGroupsForVersions_RidIndexes(indexName,value);
CREATE TABLE RKPlaceForVersion (modelId integer primary key, versionId integer, placeId integer);
CREATE INDEX RKPlaceForVersion_versionId_index on RKPlaceForVersion(versionId);
CREATE INDEX RKPlaceForVersion_placeId_index on RKPlaceForVersion(placeId);
CREATE INDEX RKPlaceForVersion_placeId_versionId_index on RKPlaceForVersion(placeId,versionId);
CREATE TABLE RKAlbum (modelId integer primary key, uuid varchar, albumType integer, albumSubclass integer, serviceName varchar, serviceAccountName varchar, serviceFullName varchar, name varchar, folderUuid varchar, queryFolderUuid varchar, posterVersionUuid varchar, selectedTrackPathUuid varchar, sortKeyPath varchar, sortAscending integer, customSortAvailable integer, versionCount integer, createDate timestamp, isFavorite integer, isInTrash integer, isHidden integer, isMagic integer, publishSyncNeeded integer, colorLabelIndex integer, faceSortKeyPath varchar, recentUserChangeDate timestamp, filterData blob, queryData blob, viewData blob, selectedVersionIds blob);
CREATE INDEX RKAlbum_uuid_index on RKAlbum(uuid);
CREATE INDEX RKAlbum_albumSubclass_index on RKAlbum(albumSubclass);
CREATE INDEX RKAlbum_serviceName_index on RKAlbum(serviceName);
CREATE INDEX RKAlbum_folderUuid_index on RKAlbum(folderUuid);
CREATE INDEX RKAlbum_queryFolderUuid_index on RKAlbum(queryFolderUuid);
CREATE INDEX RKAlbum_createDate_index on RKAlbum(createDate);
CREATE INDEX RKAlbum_isInTrash_index on RKAlbum(isInTrash);
CREATE INDEX RKAlbum_recentUserChangeDate_index on RKAlbum(recentUserChangeDate);
CREATE INDEX RKAlbum_name_folderUuid_index on RKAlbum(name,folderUuid);
CREATE TABLE RKAlbum_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKAlbum_RidIndexes_indexName_value_index on RKAlbum_RidIndexes(indexName,value);
CREATE TABLE RKVault (modelId integer primary key, uuid varchar, name varchar, vaultVersion integer, vaultStatus varchar, volumePath varchar, volumeRelativePath varchar, savePreviews integer, saveReferencedFiles integer, createDate timestamp, lastUpdate timestamp, vaultSize integer, capacity integer, availableSpace integer, isExpanded integer);
CREATE INDEX RKVault_uuid_index on RKVault(uuid);
CREATE TABLE RKVersionGroup (modelId integer primary key, uuid varchar, relationshipType integer);
CREATE INDEX RKVersionGroup_uuid_index on RKVersionGroup(uuid);
CREATE INDEX RKVersionGroup_relationshipType_index on RKVersionGroup(relationshipType);
CREATE TABLE RKImageMask (modelId integer primary key, uuid varchar, createDate timestamp);
CREATE INDEX RKImageMask_uuid_index on RKImageMask(uuid);
CREATE INDEX RKImageMask_createDate_index on RKImageMask(createDate);
CREATE TABLE RKGroupsForMasters (modelId integer primary key, groupId integer, masterId integer, masterUuid varchar, relationshipType integer);
CREATE INDEX RKGroupsForMasters_groupId_index on RKGroupsForMasters(groupId);
CREATE INDEX RKGroupsForMasters_masterId_index on RKGroupsForMasters(masterId);
CREATE INDEX RKGroupsForMasters_masterUuid_index on RKGroupsForMasters(masterUuid);
CREATE INDEX RKGroupsForMasters_relationshipType_index on RKGroupsForMasters(relationshipType);
CREATE TABLE RKGroupsForMasters_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKGroupsForMasters_RidIndexes_indexName_value_index on RKGroupsForMasters_RidIndexes(indexName,value);
CREATE TABLE RKKeyword_CharIndex (modelId integer primary key, uuid varchar, character integer, stringIds blob);
CREATE INDEX RKKeyword_CharIndex_uuid_index on RKKeyword_CharIndex(uuid);
CREATE INDEX RKKeyword_CharIndex_character_index on RKKeyword_CharIndex(character);
Face data is in `Faces.apdb`
CREATE TABLE RKFaceName (modelId integer primary key, uuid varchar, faceKey integer, keyVersionUuid varchar, name varchar, fullName varchar, email varchar, similarFacesCached integer, similarFacesOpen integer, manualOrder integer, lastUsedDate timestamp, attrs blob);
CREATE INDEX RKFaceName_uuid_index on RKFaceName(uuid);
CREATE INDEX RKFaceName_faceKey_index on RKFaceName(faceKey);
CREATE INDEX RKFaceName_keyVersionUuid_index on RKFaceName(keyVersionUuid);
CREATE TABLE RKSimilarFaces (modelId integer primary key, seedFaceKey integer, faceKey integer, detectedFaceId integer, score decimal, ignored integer);
CREATE INDEX RKSimilarFaces_seedFaceKey_index on RKSimilarFaces(seedFaceKey);
CREATE INDEX RKSimilarFaces_faceKey_index on RKSimilarFaces(faceKey);
CREATE INDEX RKSimilarFaces_detectedFaceId_index on RKSimilarFaces(detectedFaceId);
CREATE TABLE RKDetectedFaceBlob (modelId integer primary key, detectedFaceId integer, recogBuffer blob, histogram64Buffer blob);
CREATE INDEX RKDetectedFaceBlob_detectedFaceId_index on RKDetectedFaceBlob(detectedFaceId);
CREATE TABLE RKDetectedFaceExternal (modelId integer primary key, serviceKey varchar, detectedFaceId integer, albumUuid varchar, versionUuid varchar, publicationUID varchar, serviceData blob);
CREATE INDEX RKDetectedFaceExternal_detectedFaceId_index on RKDetectedFaceExternal(detectedFaceId);
CREATE INDEX RKDetectedFaceExternal_albumUuid_index on RKDetectedFaceExternal(albumUuid);
CREATE INDEX RKDetectedFaceExternal_versionUuid_index on RKDetectedFaceExternal(versionUuid);
CREATE TABLE RKDetectedFace (modelId integer primary key, uuid varchar, masterUuid varchar, altMasterUuid varchar, faceKey integer, correlatedFaceKey integer, ownerServiceKey varchar, faceIndex integer, width decimal, height decimal, topLeftX decimal, topLeftY decimal, topRightX decimal, topRightY decimal, bottomLeftX decimal, bottomLeftY decimal, bottomRightX decimal, bottomRightY decimal, confidence decimal, sharpness decimal, exposureValue decimal, rejected integer, faceCount integer, ignore integer, faceFlags integer, hasFaceTile integer, tileFacePosition integer, faceAngle decimal, faceDirectionAngle decimal, faceSkinScore decimal, skippedInUnnamedFaces integer);
CREATE INDEX RKDetectedFace_uuid_index on RKDetectedFace(uuid);
CREATE INDEX RKDetectedFace_masterUuid_index on RKDetectedFace(masterUuid);
CREATE INDEX RKDetectedFace_altMasterUuid_index on RKDetectedFace(altMasterUuid);
CREATE INDEX RKDetectedFace_faceKey_index on RKDetectedFace(faceKey);
CREATE INDEX RKDetectedFace_correlatedFaceKey_index on RKDetectedFace(correlatedFaceKey);
CREATE INDEX RKDetectedFace_ownerServiceKey_index on RKDetectedFace(ownerServiceKey);
CREATE INDEX RKDetectedFace_ignore_index on RKDetectedFace(ignore);
CREATE INDEX RKDetectedFace_hasFaceTile_index on RKDetectedFace(hasFaceTile);
CREATE INDEX RKDetectedFace_masterUuid_faceIndex_index on RKDetectedFace(masterUuid,faceIndex);
CREATE TABLE RKDetectedFace_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKDetectedFace_RidIndexes_indexName_value_index on RKDetectedFace_RidIndexes(indexName,value);
CREATE TABLE RKFaceFeature (modelId integer primary key, detectedFaceId integer, featureIndex integer, x decimal, y decimal, confidence decimal);
CREATE INDEX RKFaceFeature_detectedFaceId_index on RKFaceFeature(detectedFaceId);
CREATE TABLE RKFaceExternal (modelId integer primary key, faceKey integer, serviceKey varchar, reference varchar);
CREATE INDEX RKFaceExternal_serviceKey_reference_index on RKFaceExternal(serviceKey,reference);
CREATE INDEX RKFaceExternal_serviceKey_faceKey_index on RKFaceExternal(serviceKey,faceKey);

There's also a Properties.apdb

CREATE TABLE RKStatistic (modelId integer primary key, versionId integer, propertyKey varchar, numberProperty decimal, modDate timestamp);
CREATE INDEX RKStatistic_versionId_index on RKStatistic(versionId);
CREATE INDEX RKStatistic_numberProperty_index on RKStatistic(numberProperty);
CREATE INDEX RKStatistic_modDate_index on RKStatistic(modDate);
CREATE UNIQUE INDEX RKStatistic_propertyKey_versionId_index on RKStatistic(propertyKey,versionId);
CREATE TABLE RKExifNumberProperty (modelId integer primary key, versionId integer, propertyKey varchar, numberProperty decimal, modDate timestamp);
CREATE INDEX RKExifNumberProperty_versionId_index on RKExifNumberProperty(versionId);
CREATE INDEX RKExifNumberProperty_numberProperty_index on RKExifNumberProperty(numberProperty);
CREATE INDEX RKExifNumberProperty_modDate_index on RKExifNumberProperty(modDate);
CREATE UNIQUE INDEX RKExifNumberProperty_propertyKey_versionId_index on RKExifNumberProperty(propertyKey,versionId);
CREATE TABLE RKPlace (modelId integer primary key, uuid varchar, defaultName varchar, recordLocator integer, type integer, isLowest integer, userDefined integer, geoVersion decimal, minLongitude decimal, maxLongitude decimal, minLatitude decimal, maxLatitude decimal, centroid varchar, createDate timestamp, modDate timestamp, boundaryData blob);
CREATE INDEX RKPlace_uuid_index on RKPlace(uuid);
CREATE INDEX RKPlace_recordLocator_index on RKPlace(recordLocator);
CREATE INDEX RKPlace_type_index on RKPlace(type);
CREATE INDEX RKPlace_isLowest_index on RKPlace(isLowest);
CREATE INDEX RKPlace_userDefined_index on RKPlace(userDefined);
CREATE INDEX RKPlace_createDate_index on RKPlace(createDate);
CREATE INDEX RKPlace_modDate_index on RKPlace(modDate);
CREATE VIRTUAL TABLE RKPlace_RTree using rtree(modelId integer primary key, minLatitude decimal, maxLatitude decimal, minLongitude decimal, maxLongitude decimal)
/* RKPlace_RTree(modelId,minLatitude,maxLatitude,minLongitude,maxLongitude) */;
CREATE TABLE IF NOT EXISTS "RKPlace_RTree_node"(nodeno INTEGER PRIMARY KEY, data BLOB);
CREATE TABLE IF NOT EXISTS "RKPlace_RTree_rowid"(rowid INTEGER PRIMARY KEY, nodeno INTEGER);
CREATE TABLE IF NOT EXISTS "RKPlace_RTree_parent"(nodeno INTEGER PRIMARY KEY, parentnode INTEGER);
CREATE TABLE RKUniqueString (modelId integer primary key, stringProperty varchar);
CREATE INDEX RKUniqueString_stringProperty_index on RKUniqueString(stringProperty);
CREATE TABLE RKCharacterIndex (modelId integer primary key, uuid varchar, character integer, stringIds blob);
CREATE INDEX RKCharacterIndex_uuid_index on RKCharacterIndex(uuid);
CREATE INDEX RKCharacterIndex_character_index on RKCharacterIndex(character);
CREATE TABLE RKFaceProperty (modelId integer primary key, faceNameId integer, propertyKey varchar, stringId integer, searchStringId integer, modDate timestamp);
CREATE INDEX RKFaceProperty_faceNameId_index on RKFaceProperty(faceNameId);
CREATE INDEX RKFaceProperty_stringId_index on RKFaceProperty(stringId);
CREATE INDEX RKFaceProperty_searchStringId_index on RKFaceProperty(searchStringId);
CREATE INDEX RKFaceProperty_modDate_index on RKFaceProperty(modDate);
CREATE UNIQUE INDEX RKFaceProperty_propertyKey_faceNameId_index on RKFaceProperty(propertyKey,faceNameId);
CREATE TABLE RKPlaceName (modelId integer primary key, placeId integer, language varchar, description varchar);
CREATE INDEX RKPlaceName_placeId_index on RKPlaceName(placeId);
CREATE INDEX RKPlaceName_language_index on RKPlaceName(language);
CREATE INDEX RKPlaceName_description_index on RKPlaceName(description);
CREATE TABLE RKIptcProperty (modelId integer primary key, versionId integer, propertyKey varchar, stringId integer, searchStringId integer, modDate timestamp);
CREATE INDEX RKIptcProperty_versionId_index on RKIptcProperty(versionId);
CREATE INDEX RKIptcProperty_stringId_index on RKIptcProperty(stringId);
CREATE INDEX RKIptcProperty_searchStringId_index on RKIptcProperty(searchStringId);
CREATE INDEX RKIptcProperty_modDate_index on RKIptcProperty(modDate);
CREATE UNIQUE INDEX RKIptcProperty_propertyKey_versionId_index on RKIptcProperty(propertyKey,versionId);
CREATE TABLE RKIptc_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKIptc_RidIndexes_indexName_value_index on RKIptc_RidIndexes(indexName,value);
CREATE TABLE RKOtherProperty (modelId integer primary key, versionId integer, propertyKey varchar, propertyType integer, stringId integer, searchStringId integer, numberProperty decimal, modDate timestamp);
CREATE INDEX RKOtherProperty_versionId_index on RKOtherProperty(versionId);
CREATE INDEX RKOtherProperty_propertyType_index on RKOtherProperty(propertyType);
CREATE INDEX RKOtherProperty_stringId_index on RKOtherProperty(stringId);
CREATE INDEX RKOtherProperty_searchStringId_index on RKOtherProperty(searchStringId);
CREATE INDEX RKOtherProperty_numberProperty_index on RKOtherProperty(numberProperty);
CREATE INDEX RKOtherProperty_modDate_index on RKOtherProperty(modDate);
CREATE UNIQUE INDEX RKOtherProperty_propertyKey_versionId_propertyType_index on RKOtherProperty(propertyKey,versionId,propertyType);
CREATE TABLE RKOther_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKOther_RidIndexes_indexName_value_index on RKOther_RidIndexes(indexName,value);
CREATE TABLE RKExifStringProperty (modelId integer primary key, versionId integer, propertyKey varchar, stringId integer, searchStringId integer, modDate timestamp);
CREATE INDEX RKExifStringProperty_versionId_index on RKExifStringProperty(versionId);
CREATE INDEX RKExifStringProperty_stringId_index on RKExifStringProperty(stringId);
CREATE INDEX RKExifStringProperty_searchStringId_index on RKExifStringProperty(searchStringId);
CREATE INDEX RKExifStringProperty_modDate_index on RKExifStringProperty(modDate);
CREATE UNIQUE INDEX RKExifStringProperty_propertyKey_versionId_index on RKExifStringProperty(propertyKey,versionId);
CREATE TABLE RKExif_RidIndexes (modelId integer primary key, indexName varchar, value varchar, ridIndex blob);
CREATE UNIQUE INDEX RKExif_RidIndexes_indexName_value_index on RKExif_RidIndexes(indexName,value);
Clone this wiki locally