Guest User

Untitled

a guest
Jul 17th, 2018
3,061
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 62.69 KB | None | 0 0
  1. ------------- SQLite3 Dump File -------------
  2. "C:\Users\Anonymous\AppData\Local\Packages\Microsoft.Windows.Photos_8wekyb3d8bbwe\LocalState\MediaDb.v1.sqlite"
  3. -- ------------------------------------------
  4. -- Dump of "Album"
  5. -- ------------------------------------------
  6. CREATE TABLE "Album"(
  7. "Album_Id" Integer PRIMARY KEY,
  8. "Album_Name" Text COLLATE NoCaseLinguistic,
  9. "Album_Type" Integer NOT NULL,
  10. "Album_State" Integer NOT NULL,
  11. "Album_QueryType" Integer NOT NULL,
  12. "Album_QueryBoundsType" Integer NOT NULL,
  13. "Album_Query" Text,
  14. "Album_DateCreated" Integer NOT NULL,
  15. "Album_DateUpdated" Integer,
  16. "Album_DateUserModified" Integer,
  17. "Album_DateViewed" Integer,
  18. "Album_DateShared" Integer,
  19. "Album_Count" Integer NOT NULL,
  20. "Album_CoverItemId" Integer,
  21. "Album_CoverBoundsLeft" Real,
  22. "Album_CoverBoundsTop" Real,
  23. "Album_CoverBoundsRight" Real,
  24. "Album_CoverBoundsBottom" Real,
  25. "Album_Visibility" Integer NOT NULL,
  26. "Album_EventStartDate" Integer,
  27. "Album_EventEndDate" Integer,
  28. "Album_SummaryStartDate" Integer,
  29. "Album_SummaryEndDate" Integer,
  30. "Album_Source" Integer,
  31. "Album_SourceId" Integer,
  32. "Album_PublishState" Integer,
  33. "Album_PendingTelemetryUploadState" Integer DEFAULT 0,
  34. "Album_SentTelemetryUploadState" Integer DEFAULT 0,
  35. "Album_ETag" Text,
  36. "Album_CreationType" Integer DEFAULT 0,
  37. "Album_Order" Integer DEFAULT 0,
  38. CONSTRAINT "Album_Item_SET NULL_NO ACTION_Album_CoverItemId__0" FOREIGN KEY ( "Album_CoverItemId" ) REFERENCES "Item"
  39. ON DELETE Set NULL
  40. ,
  41. CONSTRAINT "Album_Source_CASCADE_NO ACTION_Album_SourceId__0" FOREIGN KEY ( "Album_SourceId" ) REFERENCES "Source"
  42. ON DELETE Cascade
  43. );
  44. CREATE INDEX "Album_CoverItemId" ON "Album"( "Album_CoverItemId" );
  45. CREATE INDEX "Album_SourceId" ON "Album"( "Album_SourceId" );
  46. CREATE INDEX "Album_State" ON "Album"( "Album_State" );
  47. CREATE TRIGGER "AlbumAfterInsert_InsertFts"
  48. AFTER INSERT
  49. ON "Album"
  50. FOR EACH ROW
  51. BEGIN INSERT INTO AlbumNameFts (docid, Album_Name) VALUES (new.Album_Id, new.Album_Name);END;
  52. CREATE TRIGGER "AlbumAfterUpdate_InsertFts"
  53. AFTER UPDATE OF "Album_Name"
  54. ON "Album"
  55. FOR EACH ROW
  56. BEGIN INSERT INTO AlbumNameFts(docid, Album_Name) VALUES(new.Album_Id, new.Album_Name);END;
  57. CREATE TRIGGER "AlbumBeforeDelete_DeleteFts"
  58. BEFORE DELETE
  59. ON "Album"
  60. FOR EACH ROW
  61. BEGIN DELETE FROM AlbumNameFts WHERE docid = old.Album_Id;END;
  62. CREATE TRIGGER "AlbumBeforeUpdate_DeleteFts"
  63. BEFORE UPDATE OF "Album_Name"
  64. ON "Album"
  65. FOR EACH ROW
  66. BEGIN DELETE FROM AlbumNameFts WHERE docid=old.Album_Id;END;
  67. -- ------------------------------------------
  68. -- Dump of "AlbumItemLink"
  69. -- ------------------------------------------
  70. -- Need to add atleast one column to create table 'AlbumItemLink'
  71. CREATE UNIQUE INDEX "AlbumItemLink_AlbumIdItemId" ON "AlbumItemLink"( "AlbumItemLink_AlbumId", "AlbumItemLink_ItemId" );
  72. CREATE INDEX "AlbumItemLink_ItemIdAlbumId" ON "AlbumItemLink"( "AlbumItemLink_ItemId", "AlbumItemLink_AlbumId" );
  73. -- ------------------------------------------
  74. -- Dump of "AlbumNameFts"
  75. -- ------------------------------------------
  76. -- Need to add atleast one column to create table 'AlbumNameFts'
  77. -- ------------------------------------------
  78. -- Dump of "AlbumNameFts_docsize"
  79. -- ------------------------------------------
  80. CREATE TABLE "AlbumNameFts_docsize"(
  81. "docid" Integer PRIMARY KEY,
  82. "size" BLOB );
  83. -- ------------------------------------------
  84. -- Dump of "AlbumNameFts_segdir"
  85. -- ------------------------------------------
  86. CREATE TABLE "AlbumNameFts_segdir"(
  87. "level" Integer,
  88. "idx" Integer,
  89. "start_block" Integer,
  90. "leaves_end_block" Integer,
  91. "end_block" Integer,
  92. "root" BLOB,
  93. PRIMARY KEY ( "level", "idx" ) );
  94. -- ------------------------------------------
  95. -- Dump of "AlbumNameFts_segments"
  96. -- ------------------------------------------
  97. CREATE TABLE "AlbumNameFts_segments"(
  98. "blockid" Integer PRIMARY KEY,
  99. "block" BLOB );
  100. -- ------------------------------------------
  101. -- Dump of "AlbumNameFts_stat"
  102. -- ------------------------------------------
  103. CREATE TABLE "AlbumNameFts_stat"(
  104. "id" Integer PRIMARY KEY,
  105. "value" BLOB );
  106.  
  107. -- ------------------------------------------
  108. -- Dump of "AppGlobalState"
  109. -- ------------------------------------------
  110. CREATE TABLE "AppGlobalState"(
  111. "AppGlobalState_AnalysisVersion" Text,
  112. "AppGlobalState_DateLastLocalReconciled" Integer,
  113. "AppGlobalState_CountLastReconciliationQueryResults" Integer,
  114. "AppGlobalState_DateLastAlbumsMaintenance" Integer,
  115. "AppGlobalState_DateLastItemDeleted" Integer,
  116. "AppGlobalState_DateLastCacheCleaned" Integer,
  117. "AppGlobalState_OneDriveDeltaSyncToken" Text,
  118. "AppGlobalState_OneDriveFullSyncCompleted" Integer,
  119. "AppGlobalState_OneDriveAlbumDeltaSyncToken" Text,
  120. "AppGlobalState_OneDriveKnownFoldersNeedUpgrade" Integer,
  121. "AppGlobalState_OneDriveItemsResyncing" Integer DEFAULT 0,
  122. "AppGlobalState_OneDriveAlbumsResyncing" Integer DEFAULT 0,
  123. "AppGlobalState_TruncateWALFilePending" Integer,
  124. "AppGlobalState_RichMediaGrovelVersion" Integer DEFAULT 0,
  125. "AppGlobalState_CurrentAutoEnhanceEnabledState" Integer,
  126. "AppGlobalState_RunDedupWork" Integer NOT NULL DEFAULT 0,
  127. "AppGlobalState_OneDriveIdentifyPicturesScope" Integer,
  128. "AppGlobalState_DeferredUpgradeVersion" Integer,
  129. "AppGlobalState_CachedLocalCollectionSize" Integer DEFAULT 0,
  130. "AppGlobalState_NewAlbumsBadgeCount" Integer DEFAULT 0,
  131. "AppGlobalState_ImportBadgeDisplayState" Integer DEFAULT 0,
  132. "AppGlobalState_DateLastTagAlbumsMaintenance" Integer,
  133. "AppGlobalState_DateLastLocationLookupReady" Integer DEFAULT 0,
  134. "AppGlobalState_DateLastPetAlbumsMaintenance" Integer,
  135. "AppGlobalState_DateLastCountryTripAlbumsMaintenance" Integer,
  136. "AppGlobalState_DateLastWeddingAlbumsMaintenance" Integer,
  137. "AppGlobalState_DateLastSmileAlbumsMaintenance" Integer,
  138. "AppGlobalState_DateLastDbAnalyze" Integer,
  139. "AppGlobalState_DateLastDbVacuum" Integer,
  140. "AppGlobalState_DateLastSeasonalAlbumsMaintenance" Integer,
  141. "AppGlobalState_XboxLiveItemsResyncing" Integer DEFAULT 0,
  142. CONSTRAINT "SingleRow" CHECK (rowid = 1) );
  143.  
  144. -- ------------------------------------------
  145. -- Dump of "AppTelemetryState"
  146. -- ------------------------------------------
  147. CREATE TABLE "AppTelemetryState"(
  148. "AppTelemetryState_EventName" Text,
  149. "AppTelemetryState_EventFireTime" Integer );
  150.  
  151.  
  152. -- ------------------------------------------
  153. -- Dump of "ApplicationName"
  154. -- ------------------------------------------
  155. CREATE TABLE "ApplicationName"(
  156. "ApplicationName_Id" Integer PRIMARY KEY,
  157. "ApplicationName_Text" Text );
  158. CREATE INDEX "ApplicationName_Text" ON "ApplicationName"( "ApplicationName_Text" );
  159.  
  160.  
  161. -- ------------------------------------------
  162. -- Dump of "Audio"
  163. -- ------------------------------------------
  164. CREATE TABLE "Audio"(
  165. "Audio_Id" Integer PRIMARY KEY,
  166. "Audio_Url" Text NOT NULL COLLATE NoCaseUnicode,
  167. "Audio_SampleRate" Integer NOT NULL,
  168. "Audio_ChannelCount" Integer NOT NULL,
  169. "Audio_IntegratedLUFS" Real NOT NULL,
  170. "Audio_WindowInfos" BLOB NOT NULL,
  171. "Audio_DurationPerWindow" Integer NOT NULL );
  172. CREATE UNIQUE INDEX "Audio_Url" ON "Audio"( "Audio_Url" );
  173. -- ------------------------------------------
  174. -- Dump of "BackgroundTaskTelemetry"
  175. -- ------------------------------------------
  176. CREATE TABLE "BackgroundTaskTelemetry"(
  177. "BackgroundTaskTelemetry_Id" Integer NOT NULL,
  178. "BackgroundTaskTelemetry_State" Integer NOT NULL,
  179. "BackgroundTaskTelemetry_Reason" Integer NOT NULL,
  180. "BackgroundTaskTelemetry_Count" Integer NOT NULL,
  181. "BackgroundTaskTelemetry_TotalTime" Integer DEFAULT 0,
  182. "BackgroundTaskTelemetry_MinTime" Integer DEFAULT 0,
  183. "BackgroundTaskTelemetry_MaxTime" Integer DEFAULT 0,
  184. "BackgroundTaskTelemetry_CorrelationGuid" Text NOT NULL );
  185.  
  186. -- ------------------------------------------
  187. -- Dump of "Cache"
  188. -- ------------------------------------------
  189. -- Need to add atleast one column to create table 'Cache'
  190. -- ------------------------------------------
  191. -- Dump of "CameraManufacturer"
  192. -- ------------------------------------------
  193. CREATE TABLE "CameraManufacturer"(
  194. "CameraManufacturer_Id" Integer PRIMARY KEY,
  195. "CameraManufacturer_Text" Text );
  196. CREATE INDEX "CameraManufacturer_Text" ON "CameraManufacturer"( "CameraManufacturer_Text" );
  197.  
  198. -- ------------------------------------------
  199. -- Dump of "CameraModel"
  200. -- ------------------------------------------
  201. CREATE TABLE "CameraModel"(
  202. "CameraModel_Id" Integer PRIMARY KEY,
  203. "CameraModel_Text" Text );
  204. CREATE INDEX "CameraModel_Text" ON "CameraModel"( "CameraModel_Text" );
  205.  
  206. -- ------------------------------------------
  207. -- Dump of "CloudAlbum"
  208. -- ------------------------------------------
  209. CREATE TABLE "CloudAlbum"(
  210. "CloudAlbum_Id" Integer PRIMARY KEY );
  211. CREATE INDEX "CloudAlbum_CloudId" ON "CloudAlbum"( "CloudAlbum_CloudId" );
  212. -- ------------------------------------------
  213. -- Dump of "ConceptTagSuppressedTagList"
  214. -- ------------------------------------------
  215. CREATE TABLE "ConceptTagSuppressedTagList"(
  216. "ConceptTagSuppressedTagList_TagResourceId" Integer );
  217. -- ------------------------------------------
  218. -- Dump of "DecisionServiceAction"
  219. -- ------------------------------------------
  220. CREATE TABLE "DecisionServiceAction"(
  221. "DecisionServiceAction_Name" Text NOT NULL,
  222. "DecisionServiceAction_Json" Text NOT NULL );
  223. CREATE UNIQUE INDEX "DecisionServiceAction_Name" ON "DecisionServiceAction"( "DecisionServiceAction_Name" );
  224. -- ------------------------------------------
  225. -- Dump of "Event"
  226. -- ------------------------------------------
  227. CREATE TABLE "Event"(
  228. "Event_Id" Integer PRIMARY KEY,
  229. "Event_StartDate" Integer,
  230. "Event_EndDate" Integer,
  231. "Event_Size" Integer );
  232. CREATE UNIQUE INDEX "Event_StartDate" ON "Event"( "Event_StartDate" );
  233.  
  234. -- ------------------------------------------
  235. -- Dump of "ExcludedAlbum"
  236. -- ------------------------------------------
  237. CREATE TABLE "ExcludedAlbum"(
  238. "ExcludedAlbum_Id" Integer PRIMARY KEY,
  239. "ExcludedAlbum_AlbumId" Integer NOT NULL,
  240. "ExcludedAlbum_ExcludedForUse" Integer NOT NULL,
  241. "ExcludedAlbum_ExcludedDate" Integer NOT NULL,
  242. CONSTRAINT "ExcludedAlbum_Album_CASCADE_NO ACTION_ExcludedAlbum_AlbumId_Album_Id_0" FOREIGN KEY ( "ExcludedAlbum_AlbumId" ) REFERENCES "Album"( "Album_Id" )
  243. ON DELETE Cascade
  244. );
  245. CREATE INDEX "ExcludedAlbum_AlbumId" ON "ExcludedAlbum"( "ExcludedAlbum_AlbumId" );
  246. CREATE INDEX "ExcludedAlbum_ExcludedForUse" ON "ExcludedAlbum"( "ExcludedAlbum_ExcludedForUse" );
  247. -- ------------------------------------------
  248. -- Dump of "ExcludedFace"
  249. -- ------------------------------------------
  250. CREATE TABLE "ExcludedFace"(
  251. "ExcludedFace_Id" Integer PRIMARY KEY );
  252. CREATE INDEX "ExcludedFace_FaceClusterId" ON "ExcludedFace"( "ExcludedFace_FaceClusterId" );
  253. CREATE INDEX "ExcludedFace_FaceId" ON "ExcludedFace"( "ExcludedFace_FaceId" );
  254. -- ------------------------------------------
  255. -- Dump of "ExcludedImport"
  256. -- ------------------------------------------
  257. CREATE TABLE "ExcludedImport"(
  258. "ExcludedImport_Id" Integer PRIMARY KEY,
  259. "ExcludedImport_ImportId" Integer NOT NULL,
  260. "ExcludedImport_ExcludedForUse" Integer NOT NULL,
  261. "ExcludedImport_ExcludedDate" Integer NOT NULL );
  262. CREATE INDEX "ExcludedImport_ExcludedForUse" ON "ExcludedImport"( "ExcludedImport_ExcludedForUse" );
  263. -- ------------------------------------------
  264. -- Dump of "ExcludedItemTag"
  265. -- ------------------------------------------
  266. CREATE TABLE "ExcludedItemTag"(
  267. "ExcludedItemTag_Id" Integer PRIMARY KEY );
  268. CREATE INDEX "ExcludedItemTag_ItemId" ON "ExcludedItemTag"( "ExcludedItemTag_ItemId" );
  269. CREATE INDEX "ExcludedItemTag_TagId" ON "ExcludedItemTag"( "ExcludedItemTag_TagId" );
  270. -- ------------------------------------------
  271. -- Dump of "ExcludedTag"
  272. -- ------------------------------------------
  273. CREATE TABLE "ExcludedTag"(
  274. "ExcludedTag_Id" Integer PRIMARY KEY,
  275. "ExcludedTag_TagId" Integer NOT NULL,
  276. "ExcludedTag_ExcludedForUse" Integer NOT NULL,
  277. "ExcludedTag_ExcludedDate" Integer NOT NULL,
  278. CONSTRAINT "ExcludedTag_Tag_CASCADE_NO ACTION_ExcludedTag_TagId_Tag_Id_0" FOREIGN KEY ( "ExcludedTag_TagId" ) REFERENCES "Tag"( "Tag_Id" )
  279. ON DELETE Cascade
  280. );
  281. CREATE INDEX "ExcludedTag_ExcludedForUse" ON "ExcludedTag"( "ExcludedTag_ExcludedForUse" );
  282. CREATE INDEX "ExcludedTag_TagId" ON "ExcludedTag"( "ExcludedTag_TagId" );
  283. -- ------------------------------------------
  284. -- Dump of "ExtractedText"
  285. -- ------------------------------------------
  286. CREATE TABLE "ExtractedText"(
  287. "ExtractedText_Id" Integer PRIMARY KEY );
  288. -- ------------------------------------------
  289. -- Dump of "Face"
  290. -- ------------------------------------------
  291. CREATE TABLE "Face"(
  292. "Face_Id" Integer PRIMARY KEY );
  293. CREATE INDEX "Face_ExemplarScore" ON "Face"( "Face_ExemplarScore" );
  294. CREATE INDEX "Face_ItemId" ON "Face"( "Face_ItemId" );
  295. CREATE INDEX "Face_PersonId" ON "Face"( "Face_PersonId" );
  296. CREATE INDEX "Face_QualityScore" ON "Face"( "Face_QualityScore" );
  297. CREATE INDEX "Face_RecoGroupId" ON "Face"( "Face_RecoGroupId" );
  298. CREATE TRIGGER "addFaceUpdatePerson"
  299. AFTER INSERT
  300. ON "Face"
  301. FOR EACH ROW
  302. BEGIN UPDATE Person SET Person_ItemCount = Person_ItemCount + 1 WHERE Person_Id = New.Face_PersonId; END;
  303. CREATE TRIGGER "removeFaceUpdatePerson"
  304. AFTER DELETE
  305. ON "Face"
  306. FOR EACH ROW
  307. BEGIN UPDATE Person SET Person_ItemCount = Person_ItemCount - 1 WHERE Person_Id = Old.Face_PersonId; END;
  308. CREATE TRIGGER "updateFaceUpdatePerson"
  309. BEFORE UPDATE OF "Face_PersonId"
  310. ON "Face"
  311. FOR EACH ROW
  312. BEGIN UPDATE Person SET Person_ItemCount = Person_ItemCount + 1 WHERE Person_Id = New.Face_PersonId; UPDATE Person SET Person_ItemCount = Person_ItemCount - 1 WHERE Person_Id = Old.Face_PersonId; END;
  313.  
  314. -- ------------------------------------------
  315. -- Dump of "FaceCluster"
  316. -- ------------------------------------------
  317. CREATE TABLE "FaceCluster"(
  318. "FaceCluster_Id" Integer PRIMARY KEY,
  319. "FaceCluster_PersonId" Integer,
  320. "FaceCluster_BestFaceId" Integer,
  321. CONSTRAINT "FaceCluster_Person_SET NULL_NO ACTION_FaceCluster_PersonId__0" FOREIGN KEY ( "FaceCluster_PersonId" ) REFERENCES "Person"
  322. ON DELETE Set NULL
  323. ,
  324. CONSTRAINT "FaceCluster_Face_SET NULL_NO ACTION_FaceCluster_BestFaceId__0" FOREIGN KEY ( "FaceCluster_BestFaceId" ) REFERENCES "Face"
  325. ON DELETE Set NULL
  326. );
  327. CREATE INDEX "FaceCluster_BestFaceId" ON "FaceCluster"( "FaceCluster_BestFaceId" );
  328. CREATE INDEX "FaceCluster_PersonId" ON "FaceCluster"( "FaceCluster_PersonId" );
  329.  
  330. -- ------------------------------------------
  331. -- Dump of "FaceFeature"
  332. -- ------------------------------------------
  333. -- Need to add atleast one column to create table 'FaceFeature'
  334.  
  335. -- ------------------------------------------
  336. -- Dump of "FileExtensionFts"
  337. -- ------------------------------------------
  338. -- Need to add atleast one column to create table 'FileExtensionFts'
  339. -- ------------------------------------------
  340. -- Dump of "FileExtensionFts_docsize"
  341. -- ------------------------------------------
  342. CREATE TABLE "FileExtensionFts_docsize"(
  343. "docid" Integer PRIMARY KEY,
  344. "size" BLOB );
  345. -- ------------------------------------------
  346. -- Dump of "FileExtensionFts_segdir"
  347. -- ------------------------------------------
  348. CREATE TABLE "FileExtensionFts_segdir"(
  349. "level" Integer,
  350. "idx" Integer,
  351. "start_block" Integer,
  352. "leaves_end_block" Integer,
  353. "end_block" Integer,
  354. "root" BLOB,
  355. PRIMARY KEY ( "level", "idx" ) );
  356. -- ------------------------------------------
  357. -- Dump of "FileExtensionFts_segments"
  358. -- ------------------------------------------
  359. CREATE TABLE "FileExtensionFts_segments"(
  360. "blockid" Integer PRIMARY KEY,
  361. "block" BLOB );
  362.  
  363.  
  364. -- ------------------------------------------
  365. -- Dump of "FileExtensionFts_stat"
  366. -- ------------------------------------------
  367. CREATE TABLE "FileExtensionFts_stat"(
  368. "id" Integer PRIMARY KEY,
  369. "value" BLOB );
  370.  
  371. -- ------------------------------------------
  372. -- Dump of "FilenameFts"
  373. -- ------------------------------------------
  374. -- Need to add atleast one column to create table 'FilenameFts'
  375. -- ------------------------------------------
  376. -- Dump of "FilenameFts_docsize"
  377. -- ------------------------------------------
  378. CREATE TABLE "FilenameFts_docsize"(
  379. "docid" Integer PRIMARY KEY,
  380. "size" BLOB );
  381. -- ------------------------------------------
  382. -- Dump of "FilenameFts_segdir"
  383. -- ------------------------------------------
  384. CREATE TABLE "FilenameFts_segdir"(
  385. "level" Integer,
  386. "idx" Integer,
  387. "start_block" Integer,
  388. "leaves_end_block" Integer,
  389. "end_block" Integer,
  390. "root" BLOB,
  391. PRIMARY KEY ( "level", "idx" ) );
  392.  
  393. -- ------------------------------------------
  394. -- Dump of "FilenameFts_segments"
  395. -- ------------------------------------------
  396. CREATE TABLE "FilenameFts_segments"(
  397. "blockid" Integer PRIMARY KEY,
  398. "block" BLOB );
  399. -- ------------------------------------------
  400. -- Dump of "FilenameFts_stat"
  401. -- ------------------------------------------
  402. CREATE TABLE "FilenameFts_stat"(
  403. "id" Integer PRIMARY KEY,
  404. "value" BLOB );
  405.  
  406. -- ------------------------------------------
  407. -- Dump of "Folder"
  408. -- ------------------------------------------
  409. CREATE TABLE "Folder"(
  410. "Folder_Id" Integer PRIMARY KEY,
  411. "Folder_ParentFolderId" Integer,
  412. "Folder_LibraryRelationship" Integer,
  413. "Folder_Source" Integer,
  414. "Folder_SourceId" Integer,
  415. "Folder_Path" Text COLLATE NoCaseUnicode,
  416. "Folder_DisplayName" Text COLLATE NoCaseLinguistic,
  417. "Folder_DateCreated" Integer,
  418. "Folder_DateModified" Integer,
  419. "Folder_KnownFolderType" Integer,
  420. "Folder_SyncWith" Integer,
  421. "Folder_StorageProviderFileId" Text,
  422. "Folder_InOneDrivePicturesScope" Integer,
  423. "Folder_ItemCount" Integer,
  424. CONSTRAINT "Folder_Folder_CASCADE_NO ACTION_Folder_ParentFolderId__0" FOREIGN KEY ( "Folder_ParentFolderId" ) REFERENCES "Folder"
  425. ON DELETE Cascade
  426. ,
  427. CONSTRAINT "Folder_Source_CASCADE_NO ACTION_Folder_SourceId__0" FOREIGN KEY ( "Folder_SourceId" ) REFERENCES "Source"
  428. ON DELETE Cascade
  429. );
  430. CREATE INDEX "Folder_KnownFolderType" ON "Folder"( "Folder_KnownFolderType" );
  431. CREATE INDEX "Folder_ParentFolderId" ON "Folder"( "Folder_ParentFolderId" );
  432. CREATE UNIQUE INDEX "Folder_Path" ON "Folder"( "Folder_Path" );
  433. CREATE INDEX "Folder_Source" ON "Folder"( "Folder_Source" );
  434. CREATE INDEX "Folder_SourceId" ON "Folder"( "Folder_SourceId" );
  435. CREATE INDEX "Folder_StorageProviderFileId" ON "Folder"( "Folder_StorageProviderFileId" );
  436. CREATE INDEX "Folder_SyncWith" ON "Folder"( "Folder_SyncWith" );
  437. CREATE TRIGGER "FolderAfterInsert_InsertFts"
  438. AFTER INSERT
  439. ON "Folder"
  440. FOR EACH ROW
  441. BEGIN INSERT INTO FolderNameFts (docid, Folder_DisplayName) VALUES (new.Folder_Id, new.Folder_DisplayName);END;
  442. CREATE TRIGGER "FolderAfterUpdate_InsertFts"
  443. AFTER UPDATE OF "Folder_DisplayName"
  444. ON "Folder"
  445. FOR EACH ROW
  446. WHEN old.Folder_DisplayName IS NOT new.Folder_DisplayName
  447. BEGIN INSERT INTO FolderNameFts(docid, Folder_DisplayName) VALUES(new.Folder_Id, new.Folder_DisplayName);END;
  448. CREATE TRIGGER "FolderBeforeDelete_DeleteFts"
  449. BEFORE DELETE
  450. ON "Folder"
  451. FOR EACH ROW
  452. BEGIN DELETE FROM FolderNameFts WHERE docid = old.Folder_Id;END;
  453. CREATE TRIGGER "FolderBeforeUpdate_DeleteFts"
  454. BEFORE UPDATE OF "Folder_DisplayName"
  455. ON "Folder"
  456. FOR EACH ROW
  457. WHEN old.Folder_DisplayName IS NOT new.Folder_DisplayName
  458. BEGIN DELETE FROM FolderNameFts WHERE docid=old.Folder_Id;END;
  459. CREATE TRIGGER "localSyncedFolderDeleted"
  460. AFTER DELETE
  461. ON "Folder"
  462. FOR EACH ROW
  463. WHEN Old.Folder_SyncWith IS NULL AND Old.Folder_Source = 1
  464. BEGIN UPDATE Folder SET Folder_SyncWith=NULL WHERE Folder_SyncWith=Old.Folder_Id;END;
  465. -- ------------------------------------------
  466. -- Dump of "FolderNameFts"
  467. -- ------------------------------------------
  468. -- Need to add atleast one column to create table 'FolderNameFts'
  469.  
  470. -- ------------------------------------------
  471. -- Dump of "FolderNameFts_docsize"
  472. -- ------------------------------------------
  473. CREATE TABLE "FolderNameFts_docsize"(
  474. "docid" Integer PRIMARY KEY,
  475. "size" BLOB );
  476.  
  477. -- ------------------------------------------
  478. -- Dump of "FolderNameFts_segdir"
  479. -- ------------------------------------------
  480. CREATE TABLE "FolderNameFts_segdir"(
  481. "level" Integer,
  482. "idx" Integer,
  483. "start_block" Integer,
  484. "leaves_end_block" Integer,
  485. "end_block" Integer,
  486. "root" BLOB,
  487. PRIMARY KEY ( "level", "idx" ) );
  488.  
  489. -- ------------------------------------------
  490. -- Dump of "FolderNameFts_segments"
  491. -- ------------------------------------------
  492. CREATE TABLE "FolderNameFts_segments"(
  493. "blockid" Integer PRIMARY KEY,
  494. "block" BLOB );
  495. -- ------------------------------------------
  496. -- Dump of "FolderNameFts_stat"
  497. -- ------------------------------------------
  498. CREATE TABLE "FolderNameFts_stat"(
  499. "id" Integer PRIMARY KEY,
  500. "value" BLOB );
  501.  
  502. -- ------------------------------------------
  503. -- Dump of "ImageAnalysis"
  504. -- ------------------------------------------
  505. -- Need to add atleast one column to create table 'ImageAnalysis'
  506.  
  507.  
  508. -- ------------------------------------------
  509. -- Dump of "Item"
  510. -- ------------------------------------------
  511. CREATE TABLE "Item"(
  512. "Item_Id" Integer PRIMARY KEY,
  513. "Item_LibraryRelationship" Integer,
  514. "Item_Source" Integer,
  515. "Item_SourceId" Integer,
  516. "Item_MediaType" Integer,
  517. "Item_DateTaken" Integer,
  518. "Item_Width" Integer,
  519. "Item_Height" Integer,
  520. "Item_EditState" Integer,
  521. "Item_DateCreated" Integer,
  522. "Item_DateModified" Integer,
  523. "Item_ExclusiveDateTaken" Integer,
  524. "Item_SystemThumbnailCacheId" Integer,
  525. CONSTRAINT "Item_Source_CASCADE_NO ACTION_Item_SourceId__0" FOREIGN KEY ( "Item_SourceId" ) REFERENCES "Source"
  526. ON DELETE Cascade
  527. );
  528. CREATE INDEX "Item_BurstClusterNumber" ON "Item"( "Item_BurstClusterNumber" );
  529. CREATE INDEX "Item_DateCreated" ON "Item"( "Item_DateCreated" );
  530. CREATE INDEX "Item_DateDupFinding" ON "Item"( "Item_DateDupFinding" );
  531. CREATE INDEX "Item_DateIngested" ON "Item"( "Item_DateIngested" );
  532. CREATE INDEX "Item_DateTaken" ON "Item"( "Item_DateTaken" );
  533. CREATE INDEX "Item_EditState" ON "Item"( "Item_EditState" );
  534. CREATE INDEX "Item_EventId" ON "Item"( "Item_EventId" );
  535. CREATE INDEX "Item_FileExtension" ON "Item"( "Item_FileExtension" );
  536. CREATE INDEX "Item_LibraryRelationship" ON "Item"( "Item_LibraryRelationship" );
  537. CREATE INDEX "Item_LocationId" ON "Item"( "Item_LocationId" );
  538. CREATE INDEX "Item_MediaType" ON "Item"( "Item_MediaType" );
  539. CREATE INDEX "Item_MetadataHash" ON "Item"( "Item_MetadataHash" );
  540. CREATE INDEX "Item_ParentFolderIdFileName" ON "Item"( "Item_ParentFolderId", "Item_FileName" );
  541. CREATE INDEX "Item_RichMediaSlowGrovelPending" ON "Item"( "Item_RichMediaSlowGrovelPending" );
  542. CREATE INDEX "Item_SameAs" ON "Item"( "Item_SameAs" );
  543. CREATE INDEX "Item_Source" ON "Item"( "Item_Source" );
  544. CREATE INDEX "Item_SourceId" ON "Item"( "Item_SourceId" );
  545. CREATE INDEX "Item_StorageProviderFileId" ON "Item"( "Item_StorageProviderFileId" );
  546. CREATE INDEX "Item_SyncWith" ON "Item"( "Item_SyncWith" );
  547. CREATE INDEX "Item_UserSelectedDupId" ON "Item"( "Item_UserSelectedDupId" );
  548. CREATE TRIGGER "InsertItemDateTaken_AfterInsertItem"
  549. AFTER INSERT
  550. ON "Item"
  551. FOR EACH ROW
  552. WHEN new.Item_DateTaken IS NOT NULL
  553. BEGIN INSERT OR REPLACE INTO ItemDateTaken (ItemDateTaken_ItemId,ItemDateTaken_Year, ItemDateTaken_Month, ItemDateTaken_Day, ItemDateTaken_DayOfWeek ) VALUES (new.Item_Id, strftime('%Y', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), strftime('%m', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), strftime('%d', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), strftime('%w', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch') ); END;
  554. CREATE TRIGGER "ItemAfterInsert_InsertFts"
  555. AFTER INSERT
  556. ON "Item"
  557. FOR EACH ROW
  558. BEGIN INSERT INTO FilenameFts (docid, Item_Filename) VALUES (new.Item_Id, new.Item_Filename);INSERT INTO FileExtensionFts (docid, Item_FileExtension) VALUES (new.Item_Id, new.Item_FileExtension);END;
  559. CREATE TRIGGER "ItemAfterUpdate_InsertFts"
  560. AFTER UPDATE OF "Item_Filename", "Item_FileExtension"
  561. ON "Item"
  562. FOR EACH ROW
  563. WHEN old.Item_Filename IS NOT new.Item_Filename OR old.Item_FileExtension IS NOT new.Item_FileExtension
  564. BEGIN INSERT INTO FilenameFts(docid, Item_Filename) VALUES(new.Item_Id, new.Item_Filename);INSERT INTO FileExtensionFts(docid, Item_FileExtension) VALUES(new.Item_Id, new.Item_FileExtension);END;
  565. CREATE TRIGGER "ItemBeforeDelete_DeleteFts"
  566. BEFORE DELETE
  567. ON "Item"
  568. FOR EACH ROW
  569. BEGIN DELETE FROM FilenameFts WHERE docid = old.Item_Id;DELETE FROM FileExtensionFts WHERE docid = old.Item_Id;END;
  570. CREATE TRIGGER "ItemBeforeUpdate_DeleteFts"
  571. BEFORE UPDATE OF "Item_Filename", "Item_FileExtension"
  572. ON "Item"
  573. FOR EACH ROW
  574. WHEN old.Item_Filename IS NOT new.Item_Filename OR old.Item_FileExtension IS NOT new.Item_FileExtension
  575. BEGIN DELETE FROM FilenameFts WHERE docid=old.Item_Id;DELETE FROM FileExtensionFts WHERE docid=old.Item_Id;END;
  576. CREATE TRIGGER "UpdateItemDateTaken_AfterUpdateItem"
  577. AFTER UPDATE OF "Item_DateTaken"
  578. ON "Item"
  579. FOR EACH ROW
  580. WHEN old.Item_DateTaken IS NOT NULL AND new.Item_DateTaken IS NULL
  581. BEGIN DELETE FROM ItemDateTaken WHERE ItemDateTaken_ItemId == new.Item_Id;END;
  582. CREATE TRIGGER "UpdateItemDateTaken_AfterUpdateItem1"
  583. AFTER UPDATE OF "Item_DateTaken"
  584. ON "Item"
  585. FOR EACH ROW
  586. WHEN old.Item_DateTaken IS NULL AND new.Item_DateTaken IS NOT NULL
  587. BEGIN INSERT OR REPLACE INTO ItemDateTaken (ItemDateTaken_ItemId,ItemDateTaken_Year, ItemDateTaken_Month, ItemDateTaken_Day, ItemDateTaken_DayOfWeek ) VALUES (new.Item_Id, strftime('%Y', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), strftime('%m', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), strftime('%d', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), strftime('%w', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch') ); END;
  588. CREATE TRIGGER "UpdateItemDateTaken_AfterUpdateItem2"
  589. AFTER UPDATE OF "Item_DateTaken"
  590. ON "Item"
  591. FOR EACH ROW
  592. WHEN old.Item_DateTaken IS NOT NULL AND new.Item_DateTaken IS NOT NULL AND old.Item_DateTaken != new.Item_DateTaken
  593. BEGIN UPDATE ItemDateTaken SET ItemDateTaken_Year = strftime('%Y', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), ItemDateTaken_Month = strftime('%m', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), ItemDateTaken_Day = strftime('%d', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch'), ItemDateTaken_DayOfWeek = strftime('%w', (new.Item_DateTaken - 116444736000000000) / 10000000, 'unixepoch') WHERE ItemDateTaken_ItemId == new.Item_Id; END;
  594. CREATE TRIGGER "albumCoverUpdatePendingDelete"
  595. AFTER UPDATE OF "Item_Source"
  596. ON "Item"
  597. FOR EACH ROW
  598. WHEN New.Item_Source=4
  599. BEGIN UPDATE Album SET Album_CoverItemId=NULL WHERE Album_CoverItemId=Old.Item_Id;END;
  600. CREATE TRIGGER "dupGroupDisplayedItemDeletedV3"
  601. AFTER DELETE
  602. ON "Item"
  603. FOR EACH ROW
  604. WHEN Old.Item_UserSelectedDupId IS NULL AND Old.Item_SameAs IS NOT NULL
  605. BEGIN UPDATE Item SET Item_UserSelectedDupId=CASE WHEN Item_SameAs IS NULL THEN NULL ELSE Old.Item_SameAs END WHERE Item_UserSelectedDupId=Old.Item_Id;END;
  606. CREATE TRIGGER "dupGroupDisplayedPrimaryItemDeleted"
  607. AFTER DELETE
  608. ON "Item"
  609. FOR EACH ROW
  610. WHEN Old.Item_UserSelectedDupId IS NULL AND Old.Item_SameAs IS NULL
  611. BEGIN UPDATE Item SET Item_UserSelectedDupId=NULL WHERE Item_SameAs=Old.Item_Id OR Item_UserSelectedDupId=Old.Item_Id; END;
  612. CREATE TRIGGER "dupGroupNonPrimaryItemDeletedV3"
  613. AFTER DELETE
  614. ON "Item"
  615. FOR EACH ROW
  616. WHEN Old.Item_SameAs IS NOT NULL
  617. BEGIN UPDATE Item SET Item_SameAs=NULL, Item_DupState=NULL, Item_DateDupFinding=NULL WHERE Item_SameAs=Old.Item_SameAs OR Item_Id=Old.Item_SameAs;END;
  618. CREATE TRIGGER "dupGroupPrimaryItemDeletedV6"
  619. AFTER DELETE
  620. ON "Item"
  621. FOR EACH ROW
  622. WHEN Old.Item_SameAs IS NULL
  623. BEGIN UPDATE Item SET Item_SameAs=NULL, Item_DupState=NULL, Item_DateDupFinding=NULL WHERE Item_SameAs=Old.Item_Id;END;
  624. CREATE TRIGGER "localOneDriveItemDeleted"
  625. AFTER DELETE
  626. ON "Item"
  627. FOR EACH ROW
  628. WHEN Old.Item_SyncWith IS NULL
  629. BEGIN UPDATE Item SET Item_SyncWith=NULL WHERE Item_SyncWith=Old.Item_Id;END;
  630. CREATE TRIGGER "locationCoverUpdatePendingDelete"
  631. AFTER UPDATE OF "Item_Source"
  632. ON "Item"
  633. FOR EACH ROW
  634. WHEN New.Item_Source=4
  635. BEGIN UPDATE Location SET Location_CoverItemId=NULL WHERE Location_CoverItemId=Old.Item_Id;END;
  636. CREATE TRIGGER "primaryItemWithLocationDeleted"
  637. AFTER DELETE
  638. ON "Item"
  639. FOR EACH ROW
  640. WHEN Old.Item_LocationId IS NOT NULL AND Old.Item_SameAs IS NULL
  641. BEGIN UPDATE Location SET Location_ItemsCountExcDupes=MAX(Location_ItemsCountExcDupes-1, 0) WHERE Location_Id=Old.Item_LocationId;END;
  642. CREATE TRIGGER "updateLastItemDeleteTile"
  643. AFTER DELETE
  644. ON "Item"
  645. FOR EACH ROW
  646. BEGIN UPDATE AppGlobalState SET AppGlobalState_DateLastItemDeleted = ((julianday('now') - 2305813.5) * 864000000000.0);END;
  647. -- ------------------------------------------
  648. -- Dump of "ItemDateTaken"
  649. -- ------------------------------------------
  650. CREATE TABLE "ItemDateTaken"(
  651. "ItemDateTaken_ItemId" Integer PRIMARY KEY,
  652. "ItemDateTaken_Year" Integer,
  653. "ItemDateTaken_Month" Integer,
  654. "ItemDateTaken_Day" Integer,
  655. "ItemDateTaken_DayOfWeek" Integer );
  656. CREATE INDEX "ItemDateTaken_Day" ON "ItemDateTaken"( "ItemDateTaken_Day" );
  657. CREATE INDEX "ItemDateTaken_DayOfWeek" ON "ItemDateTaken"( "ItemDateTaken_DayOfWeek" );
  658. CREATE INDEX "ItemDateTaken_Month" ON "ItemDateTaken"( "ItemDateTaken_Month" );
  659. CREATE INDEX "ItemDateTaken_Year" ON "ItemDateTaken"( "ItemDateTaken_Year" );
  660. -- ------------------------------------------
  661. -- Dump of "ItemEdit"
  662. -- ------------------------------------------
  663. -- Need to add atleast one column to create table 'ItemEdit'
  664. CREATE INDEX "ItemEdit_ItemId" ON "ItemEdit"( "ItemEdit_ItemId" );
  665. -- ------------------------------------------
  666. -- Dump of "ItemEngineExemplar"
  667. -- ------------------------------------------
  668. CREATE TABLE "ItemEngineExemplar"(
  669. "ItemEngineExemplar_Id" Integer PRIMARY KEY );
  670. CREATE UNIQUE INDEX "ItemEngineExemplar_ItemId" ON "ItemEngineExemplar"( "ItemEngineExemplar_ItemId" );
  671.  
  672.  
  673. -- ------------------------------------------
  674. -- Dump of "ItemEngineStatus"
  675. -- ------------------------------------------
  676. CREATE TABLE "ItemEngineStatus"(
  677. "ItemEngineStatus_Id" Integer PRIMARY KEY );
  678. CREATE INDEX "ItemEngineStatus_AnalysisDone" ON "ItemEngineStatus"( "ItemEngineStatus_AnalysisDone" );
  679. CREATE UNIQUE INDEX "ItemEngineStatus_ItemId" ON "ItemEngineStatus"( "ItemEngineStatus_ItemId" );
  680. CREATE INDEX "ItemEngineStatus_LastRun" ON "ItemEngineStatus"( "ItemEngineStatus_LastRun" );
  681.  
  682.  
  683. -- ------------------------------------------
  684. -- Dump of "ItemInferredLocationExperimental"
  685. -- ------------------------------------------
  686. CREATE TABLE "ItemInferredLocationExperimental"(
  687. "ItemInferredLocationExperimental_ItemId" Integer PRIMARY KEY,
  688. "ItemInferredLocationExperimental_InferredLocationId" BLOB,
  689. CONSTRAINT "ItemInferredLocationExperimental_Location_SET NULL_NO ACTION_ItemInferredLocationExperimental_InferredLocationId__0" FOREIGN KEY ( "ItemInferredLocationExperimental_InferredLocationId" ) REFERENCES "Location"
  690. ON DELETE Set NULL
  691. );
  692. -- ------------------------------------------
  693. -- Dump of "ItemTags"
  694. -- ------------------------------------------
  695. CREATE TABLE "ItemTags"(
  696. "ItemTags_Id" Integer PRIMARY KEY );
  697. CREATE INDEX "ItemTags_ItemId" ON "ItemTags"( "ItemTags_ItemId" );
  698. CREATE UNIQUE INDEX "ItemTags_ItemId_TagId" ON "ItemTags"( "ItemTags_ItemId", "ItemTags_TagId" );
  699. CREATE INDEX "ItemTags_TagId" ON "ItemTags"( "ItemTags_TagId" );
  700.  
  701. -- ------------------------------------------
  702. -- Dump of "ItemVideoQuality"
  703. -- ------------------------------------------
  704. CREATE TABLE "ItemVideoQuality"(
  705. "ItemVideoQuality_Id" Integer PRIMARY KEY );
  706. -- ------------------------------------------
  707. -- Dump of "ItemVideoTags"
  708. -- ------------------------------------------
  709. CREATE TABLE "ItemVideoTags"(
  710. "ItemVideoTags_Id" Integer PRIMARY KEY );
  711. -- ------------------------------------------
  712. -- Dump of "LiveTile"
  713. -- ------------------------------------------
  714. -- Need to add atleast one column to create table 'LiveTile'
  715.  
  716.  
  717. -- ------------------------------------------
  718. -- Dump of "Location"
  719. -- ------------------------------------------
  720. CREATE TABLE "Location"(
  721. "Location_Id" Integer PRIMARY KEY,
  722. "Location_Name" Text,
  723. "Location_LocationRegionId" Integer,
  724. "Location_LocationCountryId" Integer,
  725. "Location_ItemsCountExcDupes" Integer DEFAULT 0,
  726. "Location_CoverItemId" Integer,
  727. "Location_LocationDistrictId" Integer,
  728. CONSTRAINT "Location_LocationRegion_SET NULL_NO ACTION_Location_LocationRegionId__0" FOREIGN KEY ( "Location_LocationRegionId" ) REFERENCES "LocationRegion"
  729. ON DELETE Set NULL
  730. ,
  731. CONSTRAINT "Location_LocationCountry_SET NULL_NO ACTION_Location_LocationCountryId__0" FOREIGN KEY ( "Location_LocationCountryId" ) REFERENCES "LocationCountry"
  732. ON DELETE Set NULL
  733. ,
  734. CONSTRAINT "Location_Item_SET NULL_NO ACTION_Location_CoverItemId__0" FOREIGN KEY ( "Location_CoverItemId" ) REFERENCES "Item"
  735. ON DELETE Set NULL
  736. ,
  737. CONSTRAINT "Location_LocationDistrict_SET NULL_NO ACTION_Location_LocationDistrictId__0" FOREIGN KEY ( "Location_LocationDistrictId" ) REFERENCES "LocationDistrict"
  738. ON DELETE Set NULL
  739. );
  740. CREATE INDEX "Location_ItemsCountExcDupes" ON "Location"( "Location_ItemsCountExcDupes" );
  741. CREATE INDEX "Location_LocationCountryId" ON "Location"( "Location_LocationCountryId" );
  742. CREATE INDEX "Location_LocationDistrictId" ON "Location"( "Location_LocationDistrictId" );
  743. CREATE INDEX "Location_LocationRegionId" ON "Location"( "Location_LocationRegionId" );
  744. CREATE TRIGGER "Location_AfterInsert"
  745. AFTER INSERT
  746. ON "Location"
  747. FOR EACH ROW
  748. WHEN new.Location_Name != ''
  749. BEGIN INSERT INTO LocationFts(docid, Location_Name) VALUES(new.Location_Id, new.Location_Name);END;
  750. CREATE TRIGGER "Location_AfterUpdate"
  751. AFTER UPDATE OF "Location_Name"
  752. ON "Location"
  753. FOR EACH ROW
  754. WHEN new.Location_Name != ''
  755. BEGIN INSERT INTO LocationFts(docid, Location_Name) VALUES(new.Location_Id, new.Location_Name);END;
  756. CREATE TRIGGER "Location_BeforeDelete"
  757. BEFORE DELETE
  758. ON "Location"
  759. FOR EACH ROW
  760. BEGIN DELETE FROM LocationFts WHERE docid = old.Location_Id;END;
  761. CREATE TRIGGER "Location_BeforeUpdate"
  762. BEFORE UPDATE OF "Location_Name"
  763. ON "Location"
  764. FOR EACH ROW
  765. BEGIN DELETE FROM LocationFts WHERE docid=old.Location_Id;END;
  766. -- ------------------------------------------
  767. -- Dump of "LocationCountry"
  768. -- ------------------------------------------
  769. CREATE TABLE "LocationCountry"(
  770. "LocationCountry_Id" Integer PRIMARY KEY,
  771. "LocationCountry_Name" Text );
  772. CREATE TRIGGER "LocationCountry_AfterInsert"
  773. AFTER INSERT
  774. ON "LocationCountry"
  775. FOR EACH ROW
  776. BEGIN INSERT INTO LocationCountryFts(docid, LocationCountry_Name) VALUES(new.LocationCountry_Id, new.LocationCountry_Name);END;
  777. CREATE TRIGGER "LocationCountry_AfterUpdate"
  778. AFTER UPDATE OF "LocationCountry_Name"
  779. ON "LocationCountry"
  780. FOR EACH ROW
  781. BEGIN INSERT INTO LocationCountryFts(docid, LocationCountry_Name) VALUES(new.LocationCountry_Id, new.LocationCountry_Name);END;
  782. CREATE TRIGGER "LocationCountry_BeforeDelete"
  783. BEFORE DELETE
  784. ON "LocationCountry"
  785. FOR EACH ROW
  786. BEGIN DELETE FROM LocationCountryFts WHERE docid = old.LocationCountry_Id;END;
  787. CREATE TRIGGER "LocationCountry_BeforeUpdate"
  788. BEFORE UPDATE OF "LocationCountry_Name"
  789. ON "LocationCountry"
  790. FOR EACH ROW
  791. BEGIN DELETE FROM LocationCountryFts WHERE docid=new.LocationCountry_Id;END;
  792. -- ------------------------------------------
  793. -- Dump of "LocationCountryFts"
  794. -- ------------------------------------------
  795. -- Need to add atleast one column to create table 'LocationCountryFts'
  796. -- ------------------------------------------
  797. -- Dump of "LocationCountryFts_docsize"
  798. -- ------------------------------------------
  799. CREATE TABLE "LocationCountryFts_docsize"(
  800. "docid" Integer PRIMARY KEY,
  801. "size" BLOB );
  802. -- ------------------------------------------
  803. -- Dump of "LocationCountryFts_segdir"
  804. -- ------------------------------------------
  805. CREATE TABLE "LocationCountryFts_segdir"(
  806. "level" Integer,
  807. "idx" Integer,
  808. "start_block" Integer,
  809. "leaves_end_block" Integer,
  810. "end_block" Integer,
  811. "root" BLOB,
  812. PRIMARY KEY ( "level", "idx" ) );
  813. -- ------------------------------------------
  814. -- Dump of "LocationCountryFts_segments"
  815. -- ------------------------------------------
  816. CREATE TABLE "LocationCountryFts_segments"(
  817. "blockid" Integer PRIMARY KEY,
  818. "block" BLOB );
  819. -- ------------------------------------------
  820. -- Dump of "LocationCountryFts_stat"
  821. -- ------------------------------------------
  822. CREATE TABLE "LocationCountryFts_stat"(
  823. "id" Integer PRIMARY KEY,
  824. "value" BLOB );
  825.  
  826. -- ------------------------------------------
  827. -- Dump of "LocationDistrict"
  828. -- ------------------------------------------
  829. CREATE TABLE "LocationDistrict"(
  830. "LocationDistrict_Id" Integer PRIMARY KEY,
  831. "LocationDistrict_Name" Text,
  832. "LocationDistrict_LocationRegionId" Integer,
  833. CONSTRAINT "LocationDistrict_LocationRegion_SET NULL_NO ACTION_LocationDistrict_LocationRegionId__0" FOREIGN KEY ( "LocationDistrict_LocationRegionId" ) REFERENCES "LocationRegion"
  834. ON DELETE Set NULL
  835. );
  836. CREATE TRIGGER "LocationDistrict_AfterInsert"
  837. AFTER INSERT
  838. ON "LocationDistrict"
  839. FOR EACH ROW
  840. BEGIN INSERT INTO LocationDistrictFts(docid, LocationDistrict_Name) VALUES(new.LocationDistrict_Id, new.LocationDistrict_Name);END;
  841. CREATE TRIGGER "LocationDistrict_AfterUpdate"
  842. AFTER UPDATE OF "LocationDistrict_Name"
  843. ON "LocationDistrict"
  844. FOR EACH ROW
  845. BEGIN INSERT INTO LocationDistrictFts(docid, LocationDistrict_Name) VALUES(new.LocationDistrict_Id, new.LocationDistrict_Name);END;
  846. CREATE TRIGGER "LocationDistrict_BeforeDelete"
  847. BEFORE DELETE
  848. ON "LocationDistrict"
  849. FOR EACH ROW
  850. BEGIN DELETE FROM LocationDistrictFts WHERE docid = old.LocationDistrict_Id;END;
  851. CREATE TRIGGER "LocationDistrict_BeforeUpdate"
  852. BEFORE UPDATE OF "LocationDistrict_Name"
  853. ON "LocationDistrict"
  854. FOR EACH ROW
  855. BEGIN DELETE FROM LocationDistrictFts WHERE docid=old.LocationDistrict_Id;END;
  856. -- ------------------------------------------
  857. -- Dump of "LocationDistrictFts"
  858. -- ------------------------------------------
  859. -- Need to add atleast one column to create table 'LocationDistrictFts'
  860. -- ------------------------------------------
  861. -- Dump of "LocationDistrictFts_docsize"
  862. -- ------------------------------------------
  863. CREATE TABLE "LocationDistrictFts_docsize"(
  864. "docid" Integer PRIMARY KEY,
  865. "size" BLOB );
  866. -- ------------------------------------------
  867. -- Dump of "LocationDistrictFts_segdir"
  868. -- ------------------------------------------
  869. CREATE TABLE "LocationDistrictFts_segdir"(
  870. "level" Integer,
  871. "idx" Integer,
  872. "start_block" Integer,
  873. "leaves_end_block" Integer,
  874. "end_block" Integer,
  875. "root" BLOB,
  876. PRIMARY KEY ( "level", "idx" ) );
  877. -- ------------------------------------------
  878. -- Dump of "LocationDistrictFts_segments"
  879. -- ------------------------------------------
  880. CREATE TABLE "LocationDistrictFts_segments"(
  881. "blockid" Integer PRIMARY KEY,
  882. "block" BLOB );
  883. -- ------------------------------------------
  884. -- Dump of "LocationDistrictFts_stat"
  885. -- ------------------------------------------
  886. CREATE TABLE "LocationDistrictFts_stat"(
  887. "id" Integer PRIMARY KEY,
  888. "value" BLOB );
  889.  
  890. -- ------------------------------------------
  891. -- Dump of "LocationFts"
  892. -- ------------------------------------------
  893. -- Need to add atleast one column to create table 'LocationFts'
  894. -- ------------------------------------------
  895. -- Dump of "LocationFts_docsize"
  896. -- ------------------------------------------
  897. CREATE TABLE "LocationFts_docsize"(
  898. "docid" Integer PRIMARY KEY,
  899. "size" BLOB );
  900. -- ------------------------------------------
  901. -- Dump of "LocationFts_segdir"
  902. -- ------------------------------------------
  903. CREATE TABLE "LocationFts_segdir"(
  904. "level" Integer,
  905. "idx" Integer,
  906. "start_block" Integer,
  907. "leaves_end_block" Integer,
  908. "end_block" Integer,
  909. "root" BLOB,
  910. PRIMARY KEY ( "level", "idx" ) );
  911. -- ------------------------------------------
  912. -- Dump of "LocationFts_segments"
  913. -- ------------------------------------------
  914. CREATE TABLE "LocationFts_segments"(
  915. "blockid" Integer PRIMARY KEY,
  916. "block" BLOB );
  917. -- ------------------------------------------
  918. -- Dump of "LocationFts_stat"
  919. -- ------------------------------------------
  920. CREATE TABLE "LocationFts_stat"(
  921. "id" Integer PRIMARY KEY,
  922. "value" BLOB );
  923.  
  924. -- ------------------------------------------
  925. -- Dump of "LocationGrid"
  926. -- ------------------------------------------
  927. CREATE TABLE "LocationGrid"(
  928. "LocationGrid_Id" Integer PRIMARY KEY,
  929. "LocationGrid_Latitude" Real,
  930. "LocationGrid_Longitude" Real,
  931. "LocationGrid_LocationId" Integer,
  932. "LocationGrid_ErrorCount" Integer,
  933. "LocationGrid_LastRun" Integer,
  934. CONSTRAINT "LocationGrid_Location_CASCADE_NO ACTION_LocationGrid_LocationId__0" FOREIGN KEY ( "LocationGrid_LocationId" ) REFERENCES "Location"
  935. ON DELETE Cascade
  936. );
  937. CREATE INDEX "LocationGrid_LatLong" ON "LocationGrid"( "LocationGrid_Latitude", "LocationGrid_Longitude" );
  938. -- ------------------------------------------
  939. -- Dump of "LocationRegion"
  940. -- ------------------------------------------
  941. CREATE TABLE "LocationRegion"(
  942. "LocationRegion_Id" Integer PRIMARY KEY,
  943. "LocationRegion_Name" Text,
  944. "LocationRegion_LocationCountryId" Integer,
  945. CONSTRAINT "LocationRegion_LocationCountry_SET NULL_NO ACTION_LocationRegion_LocationCountryId__0" FOREIGN KEY ( "LocationRegion_LocationCountryId" ) REFERENCES "LocationCountry"
  946. ON DELETE Set NULL
  947. );
  948. CREATE TRIGGER "LocationRegion_AfterInsert"
  949. AFTER INSERT
  950. ON "LocationRegion"
  951. FOR EACH ROW
  952. BEGIN INSERT INTO LocationRegionFts(docid, LocationRegion_Name) VALUES(new.LocationRegion_Id, new.LocationRegion_Name);END;
  953. CREATE TRIGGER "LocationRegion_AfterUpdate"
  954. AFTER UPDATE OF "LocationRegion_Name"
  955. ON "LocationRegion"
  956. FOR EACH ROW
  957. BEGIN INSERT INTO LocationRegionFts(docid, LocationRegion_Name) VALUES(new.LocationRegion_Id, new.LocationRegion_Name);END;
  958. CREATE TRIGGER "LocationRegion_BeforeDelete"
  959. BEFORE DELETE
  960. ON "LocationRegion"
  961. FOR EACH ROW
  962. BEGIN DELETE FROM LocationRegionFts WHERE docid = old.LocationRegion_Id;END;
  963. CREATE TRIGGER "LocationRegion_BeforeUpdate"
  964. BEFORE UPDATE OF "LocationRegion_Name"
  965. ON "LocationRegion"
  966. FOR EACH ROW
  967. BEGIN DELETE FROM LocationRegionFts WHERE docid=new.LocationRegion_Id;END;
  968. -- ------------------------------------------
  969. -- Dump of "LocationRegionFts"
  970. -- ------------------------------------------
  971. -- Need to add atleast one column to create table 'LocationRegionFts'
  972. -- ------------------------------------------
  973. -- Dump of "LocationRegionFts_docsize"
  974. -- ------------------------------------------
  975. CREATE TABLE "LocationRegionFts_docsize"(
  976. "docid" Integer PRIMARY KEY,
  977. "size" BLOB );
  978. -- ------------------------------------------
  979. -- Dump of "LocationRegionFts_segdir"
  980. -- ------------------------------------------
  981. CREATE TABLE "LocationRegionFts_segdir"(
  982. "level" Integer,
  983. "idx" Integer,
  984. "start_block" Integer,
  985. "leaves_end_block" Integer,
  986. "end_block" Integer,
  987. "root" BLOB,
  988. PRIMARY KEY ( "level", "idx" ) );
  989. -- ------------------------------------------
  990. -- Dump of "LocationRegionFts_segments"
  991. -- ------------------------------------------
  992. CREATE TABLE "LocationRegionFts_segments"(
  993. "blockid" Integer PRIMARY KEY,
  994. "block" BLOB );
  995. -- ------------------------------------------
  996. -- Dump of "LocationRegionFts_stat"
  997. -- ------------------------------------------
  998. CREATE TABLE "LocationRegionFts_stat"(
  999. "id" Integer PRIMARY KEY,
  1000. "value" BLOB );
  1001.  
  1002. -- ------------------------------------------
  1003. -- Dump of "NetworkTelemetry"
  1004. -- ------------------------------------------
  1005. CREATE TABLE "NetworkTelemetry"(
  1006. "NetworkTelemetry_Source" Integer NOT NULL,
  1007. "NetworkTelemetry_RequestType" Integer NOT NULL,
  1008. "NetworkTelemetry_IsBackgroundTaskHost" Integer NOT NULL,
  1009. "NetworkTelemetry_TotalCount" Integer NOT NULL,
  1010. "NetworkTelemetry_ByteSize" Integer NOT NULL,
  1011. PRIMARY KEY ( "NetworkTelemetry_Source", "NetworkTelemetry_RequestType", "NetworkTelemetry_IsBackgroundTaskHost" ) );
  1012.  
  1013. -- ------------------------------------------
  1014. -- Dump of "OCRItem"
  1015. -- ------------------------------------------
  1016. CREATE TABLE "OCRItem"(
  1017. "OCRItem_Id" Integer PRIMARY KEY );
  1018. CREATE INDEX "OCRItem_ItemId" ON "OCRItem"( "OCRItem_ItemId" );
  1019.  
  1020.  
  1021. -- ------------------------------------------
  1022. -- Dump of "OCRItemTextViewFts"
  1023. -- ------------------------------------------
  1024. -- Need to add atleast one column to create table 'OCRItemTextViewFts'
  1025.  
  1026. -- ------------------------------------------
  1027. -- Dump of "OCRItemTextViewFts_docsize"
  1028. -- ------------------------------------------
  1029. CREATE TABLE "OCRItemTextViewFts_docsize"(
  1030. "docid" Integer PRIMARY KEY,
  1031. "size" BLOB );
  1032.  
  1033. -- ------------------------------------------
  1034. -- Dump of "OCRItemTextViewFts_segdir"
  1035. -- ------------------------------------------
  1036. CREATE TABLE "OCRItemTextViewFts_segdir"(
  1037. "level" Integer,
  1038. "idx" Integer,
  1039. "start_block" Integer,
  1040. "leaves_end_block" Integer,
  1041. "end_block" Integer,
  1042. "root" BLOB,
  1043. PRIMARY KEY ( "level", "idx" ) );
  1044. -- ------------------------------------------
  1045. -- Dump of "OCRItemTextViewFts_segments"
  1046. -- ------------------------------------------
  1047. CREATE TABLE "OCRItemTextViewFts_segments"(
  1048. "blockid" Integer PRIMARY KEY,
  1049. "block" BLOB );
  1050. -- ------------------------------------------
  1051. -- Dump of "OCRItemTextViewFts_stat"
  1052. -- ------------------------------------------
  1053. CREATE TABLE "OCRItemTextViewFts_stat"(
  1054. "id" Integer PRIMARY KEY,
  1055. "value" BLOB );
  1056.  
  1057. -- ------------------------------------------
  1058. -- Dump of "OCRLine"
  1059. -- ------------------------------------------
  1060. CREATE TABLE "OCRLine"(
  1061. "OCRLine_Id" Integer PRIMARY KEY );
  1062. CREATE INDEX "OCRLine_OCRItemId" ON "OCRLine"( "OCRLine_OCRItemId" );
  1063. -- ------------------------------------------
  1064. -- Dump of "OCRWord"
  1065. -- ------------------------------------------
  1066. CREATE TABLE "OCRWord"(
  1067. "OCRWord_Id" Integer PRIMARY KEY );
  1068. CREATE INDEX "OCRWord_OCRLineId" ON "OCRWord"( "OCRWord_OCRLineId" );
  1069. CREATE INDEX "OCRWord_Text" ON "OCRWord"( "OCRWord_Text" );
  1070.  
  1071.  
  1072. -- ------------------------------------------
  1073. -- Dump of "OneDriveStorageAndUpsellInfo"
  1074. -- ------------------------------------------
  1075. CREATE TABLE "OneDriveStorageAndUpsellInfo"(
  1076. "OneDriveStorageAndUpsellInfo_UserId" Text PRIMARY KEY,
  1077. "OneDriveStorageAndUpsellInfo_TotalSpace" Integer DEFAULT 0,
  1078. "OneDriveStorageAndUpsellInfo_UsedSpace" Integer DEFAULT 0,
  1079. "OneDriveStorageAndUpsellInfo_IsHighestPlan" Integer DEFAULT 0,
  1080. "OneDriveStorageAndUpsellInfo_PaidSpace" Integer DEFAULT 0,
  1081. "OneDriveStorageAndUpsellInfo_CountOfClickUpsellLink" Integer DEFAULT 0,
  1082. "OneDriveStorageAndUpsellInfo_TotalSpaceForDisplay" Text,
  1083. "OneDriveStorageAndUpsellInfo_UsedSpaceForDisplay" Text,
  1084. "OneDriveStorageAndUpsellInfo_PriceForDisplay" Text,
  1085. "OneDriveStorageAndUpsellInfo_UpsellUrl" Text,
  1086. "OneDriveStorageAndUpsellInfo_UpsellState" Integer DEFAULT 0,
  1087. "OneDriveStorageAndUpsellInfo_LastGetQuotaTime" Integer DEFAULT 0,
  1088. "OneDriveStorageAndUpsellInfo_LastGetUpsellInfoTime" Integer DEFAULT 0 );
  1089.  
  1090. -- ------------------------------------------
  1091. -- Dump of "PendingUploadItem"
  1092. -- ------------------------------------------
  1093. -- Need to add atleast one column to create table 'PendingUploadItem'
  1094. CREATE INDEX "PendingUploadItem_ItemAlbum" ON "PendingUploadItem"( "PendingUploadItem_ItemId" );
  1095. -- ------------------------------------------
  1096. -- Dump of "Person"
  1097. -- ------------------------------------------
  1098. CREATE TABLE "Person"(
  1099. "Person_Id" Integer PRIMARY KEY,
  1100. "Person_CID" Integer,
  1101. "Person_ServiceId" Integer,
  1102. "Person_Name" Text COLLATE NoCaseUnicode,
  1103. "Person_SourceAndId" Text,
  1104. "Person_ItemCount" Integer DEFAULT 0,
  1105. "Person_EmailDigest" BLOB,
  1106. "Person_RepresentativeThumbStream" BLOB,
  1107. "Person_BestFaceId" Integer,
  1108. "Person_Rank" Integer,
  1109. "Person_RecalcBestFace" Integer DEFAULT 1,
  1110. "Person_RecalcRank" Integer DEFAULT 1,
  1111. CONSTRAINT "Person_Face_SET NULL_NO ACTION_Person_BestFaceId__0" FOREIGN KEY ( "Person_BestFaceId" ) REFERENCES "Face"
  1112. ON DELETE Set NULL
  1113. );
  1114. CREATE INDEX "Person_BestFaceId" ON "Person"( "Person_BestFaceId" );
  1115. CREATE INDEX "Person_Rank" ON "Person"( "Person_Rank" );
  1116. CREATE INDEX "Person_RecalcBestFace" ON "Person"( "Person_RecalcBestFace" );
  1117. CREATE INDEX "Person_RecalcRank" ON "Person"( "Person_RecalcRank" );
  1118. CREATE TRIGGER "Person_AfterInsert"
  1119. AFTER INSERT
  1120. ON "Person"
  1121. FOR EACH ROW
  1122. BEGIN INSERT INTO PersonFts(docid, Person_Name) VALUES(new.Person_Id, new.Person_Name);END;
  1123. CREATE TRIGGER "Person_AfterUpdate"
  1124. AFTER UPDATE OF "Person_Name"
  1125. ON "Person"
  1126. FOR EACH ROW
  1127. BEGIN INSERT INTO PersonFts(docid, Person_Name) VALUES(new.Person_Id, new.Person_Name);END;
  1128. CREATE TRIGGER "Person_BeforeDelete"
  1129. BEFORE DELETE
  1130. ON "Person"
  1131. FOR EACH ROW
  1132. BEGIN DELETE FROM PersonFts WHERE docid = old.Person_Id;END;
  1133. CREATE TRIGGER "Person_BeforeUpdate"
  1134. BEFORE UPDATE OF "Person_Name"
  1135. ON "Person"
  1136. FOR EACH ROW
  1137. BEGIN DELETE FROM PersonFts WHERE docid=old.Person_Id;END;
  1138. -- ------------------------------------------
  1139. -- Dump of "PersonFts"
  1140. -- ------------------------------------------
  1141. -- Need to add atleast one column to create table 'PersonFts'
  1142. -- ------------------------------------------
  1143. -- Dump of "PersonFts_docsize"
  1144. -- ------------------------------------------
  1145. CREATE TABLE "PersonFts_docsize"(
  1146. "docid" Integer PRIMARY KEY,
  1147. "size" BLOB );
  1148. -- ------------------------------------------
  1149. -- Dump of "PersonFts_segdir"
  1150. -- ------------------------------------------
  1151. CREATE TABLE "PersonFts_segdir"(
  1152. "level" Integer,
  1153. "idx" Integer,
  1154. "start_block" Integer,
  1155. "leaves_end_block" Integer,
  1156. "end_block" Integer,
  1157. "root" BLOB,
  1158. PRIMARY KEY ( "level", "idx" ) );
  1159. -- ------------------------------------------
  1160. -- Dump of "PersonFts_segments"
  1161. -- ------------------------------------------
  1162. CREATE TABLE "PersonFts_segments"(
  1163. "blockid" Integer PRIMARY KEY,
  1164. "block" BLOB );
  1165. -- ------------------------------------------
  1166. -- Dump of "PersonFts_stat"
  1167. -- ------------------------------------------
  1168. CREATE TABLE "PersonFts_stat"(
  1169. "id" Integer PRIMARY KEY,
  1170. "value" BLOB );
  1171.  
  1172. -- ------------------------------------------
  1173. -- Dump of "PinnedSearch"
  1174. -- ------------------------------------------
  1175. CREATE TABLE "PinnedSearch"(
  1176. "PinnedSearch_Id" Integer PRIMARY KEY,
  1177. "PinnedSearch_PinnedDate" Integer NOT NULL,
  1178. "PinnedSearch_SearchText" Text );
  1179. CREATE INDEX "PinnedSearch_PinnedDate" ON "PinnedSearch"( "PinnedSearch_PinnedDate" );
  1180. -- ------------------------------------------
  1181. -- Dump of "Project"
  1182. -- ------------------------------------------
  1183. CREATE TABLE "Project"(
  1184. "Project_Id" Integer PRIMARY KEY,
  1185. "Project_AlbumId" Integer,
  1186. "Project_Guid" Text NOT NULL,
  1187. "Project_Name" Text COLLATE NoCaseLinguistic,
  1188. "Project_RpmState" Text,
  1189. "Project_AgmState" Text,
  1190. "Project_DateCreated" Integer NOT NULL,
  1191. "Project_Duration" Integer,
  1192. "Project_StoryBuilderProjectState" BLOB,
  1193. CONSTRAINT "Project_Album_CASCADE_NO ACTION_Project_AlbumId__0" FOREIGN KEY ( "Project_AlbumId" ) REFERENCES "Album"
  1194. ON DELETE Cascade
  1195. );
  1196. CREATE UNIQUE INDEX "Project_AlbumId" ON "Project"( "Project_AlbumId" );
  1197. CREATE UNIQUE INDEX "Project_Guid" ON "Project"( "Project_Guid" );
  1198. -- ------------------------------------------
  1199. -- Dump of "RemoteAlbum"
  1200. -- ------------------------------------------
  1201. CREATE TABLE "RemoteAlbum"(
  1202. "RemoteAlbum_AlbumId" Integer PRIMARY KEY,
  1203. "RemoteAlbum_RemoteId" Text,
  1204. "RemoteAlbum_PresentAtSync" Integer DEFAULT 0,
  1205. "RemoteAlbum_GenericViewUrl" Text,
  1206. "RemoteAlbum_CoverDuringUpload" Text,
  1207. "RemoteAlbum_AlbumType" Integer DEFAULT 0,
  1208. "RemoteAlbum_PhotosCloudId" Text,
  1209. "RemoteAlbum_ETag" Text,
  1210. CONSTRAINT "RemoteAlbum_Album_CASCADE_NO ACTION_RemoteAlbum_AlbumId__0" FOREIGN KEY ( "RemoteAlbum_AlbumId" ) REFERENCES "Album"
  1211. ON DELETE Cascade
  1212. );
  1213. CREATE INDEX "RemoteAlbum_PhotosCloudId" ON "RemoteAlbum"( "RemoteAlbum_PhotosCloudId" );
  1214. -- ------------------------------------------
  1215. -- Dump of "RemoteItem"
  1216. -- ------------------------------------------
  1217. CREATE TABLE "RemoteItem"(
  1218. "RemoteItem_RemoteId" Text,
  1219. "RemoteItem_RemoteParentId" Text,
  1220. "RemoteItem_ItemId" Integer,
  1221. "RemoteItem_FolderId" Integer,
  1222. "RemoteItem_DownloadUrl" Text,
  1223. "RemoteItem_PresentAtSync" Integer DEFAULT 0,
  1224. "RemoteItem_PhotosCloudId" Text,
  1225. CONSTRAINT "RemoteItem_Item_CASCADE_NO ACTION_RemoteItem_ItemId__0" FOREIGN KEY ( "RemoteItem_ItemId" ) REFERENCES "Item"
  1226. ON DELETE Cascade
  1227. ,
  1228. CONSTRAINT "RemoteItem_Folder_CASCADE_NO ACTION_RemoteItem_FolderId__0" FOREIGN KEY ( "RemoteItem_FolderId" ) REFERENCES "Folder"
  1229. ON DELETE Cascade
  1230. ,
  1231. CONSTRAINT "RemoteItemIdOrFolderId" CHECK ((CASE WHEN RemoteItem_ItemId IS NOT NULL THEN 1 ELSE 0 END + CASE WHEN RemoteItem_FolderId IS NOT NULL THEN 1 ELSE 0 END) = 1) );
  1232. CREATE UNIQUE INDEX "RemoteItem_FolderId" ON "RemoteItem"( "RemoteItem_FolderId" );
  1233. CREATE UNIQUE INDEX "RemoteItem_ItemId" ON "RemoteItem"( "RemoteItem_ItemId" );
  1234. CREATE INDEX "RemoteItem_RemoteId" ON "RemoteItem"( "RemoteItem_RemoteId" );
  1235. -- ------------------------------------------
  1236. -- Dump of "RemoteProject"
  1237. -- ------------------------------------------
  1238. CREATE TABLE "RemoteProject"(
  1239. "RemoteProject_Id" Integer PRIMARY KEY,
  1240. "RemoteProject_ProjectGuid" Text NOT NULL,
  1241. "RemoteProject_PhotosCloudId" Text,
  1242. "RemoteProject_PublishState" Integer NOT NULL,
  1243. "RemoteProject_DateLastSynced" Integer,
  1244. "RemoteProject_ETag" Text,
  1245. CONSTRAINT "RemoteProject_Project_CASCADE_NO ACTION_RemoteProject_ProjectGuid_Project_Guid_0" FOREIGN KEY ( "RemoteProject_ProjectGuid" ) REFERENCES "Project"( "Project_Guid" )
  1246. ON DELETE Cascade
  1247. );
  1248. CREATE INDEX "RemoteProject_PhotosCloudId" ON "RemoteProject"( "RemoteProject_PhotosCloudId" );
  1249. CREATE INDEX "RemoteProject_ProjectGuid" ON "RemoteProject"( "RemoteProject_ProjectGuid" );
  1250. -- ------------------------------------------
  1251. -- Dump of "RemoteThumbnail"
  1252. -- ------------------------------------------
  1253. -- Need to add atleast one column to create table 'RemoteThumbnail'
  1254. CREATE INDEX "RemoteThumbnail_ItemId" ON "RemoteThumbnail"( "RemoteThumbnail_ItemId" );
  1255. -- ------------------------------------------
  1256. -- Dump of "SalientRect"
  1257. -- ------------------------------------------
  1258. CREATE TABLE "SalientRect"(
  1259. "SalientRect_Id" Integer PRIMARY KEY );
  1260. CREATE INDEX "SalientRect_ItemId" ON "SalientRect"( "SalientRect_ItemId" );
  1261.  
  1262. -- ------------------------------------------
  1263. -- Dump of "SearchAnalysisItemPriority"
  1264. -- ------------------------------------------
  1265. CREATE TABLE "SearchAnalysisItemPriority"(
  1266. "SearchAnalysisItemPriority_Id" Integer PRIMARY KEY,
  1267. "SearchAnalysisItemPriority_ItemId" Integer NOT NULL,
  1268. "SearchAnalysisItemPriority_Priority" Integer NOT NULL DEFAULT 0,
  1269. CONSTRAINT "SearchAnalysisItemPriority_Item_CASCADE_NO ACTION_SearchAnalysisItemPriority_ItemId__0" FOREIGN KEY ( "SearchAnalysisItemPriority_ItemId" ) REFERENCES "Item"
  1270. ON DELETE Cascade
  1271. );
  1272. CREATE UNIQUE INDEX "SearchAnalysisItemPriority_ItemId" ON "SearchAnalysisItemPriority"( "SearchAnalysisItemPriority_ItemId" );
  1273. -- ------------------------------------------
  1274. -- Dump of "Source"
  1275. -- ------------------------------------------
  1276. CREATE TABLE "Source"(
  1277. "Source_Id" Integer PRIMARY KEY,
  1278. "Source_Type" Integer,
  1279. "Source_UserId" Text,
  1280. "Source_UserName" Text,
  1281. "Source_Status" Integer,
  1282. "Source_ProviderType" Integer,
  1283. "Source_UserEnabled" Integer,
  1284. "Source_PhotosCloudUserId" Text );
  1285.  
  1286.  
  1287. -- ------------------------------------------
  1288. -- Dump of "Tag"
  1289. -- ------------------------------------------
  1290. CREATE TABLE "Tag"(
  1291. "Tag_Id" Integer PRIMARY KEY,
  1292. "Tag_ResourceId" Integer,
  1293. "Tag_CreatedDate" Integer );
  1294. CREATE INDEX "Tag_ResourceId" ON "Tag"( "Tag_ResourceId" );
  1295. -- ------------------------------------------
  1296. -- Dump of "TagVariant"
  1297. -- ------------------------------------------
  1298. CREATE TABLE "TagVariant"(
  1299. "TagVariant_Id" Integer PRIMARY KEY,
  1300. "TagVariant_TagResourceId" Integer,
  1301. "TagVariant_Text" Text,
  1302. "TagVariant_IsPrimary" Integer );
  1303. CREATE INDEX "TagVariant_TagResourceId" ON "TagVariant"( "TagVariant_TagResourceId" );
  1304. CREATE TRIGGER "TagVariant_AfterInsert"
  1305. AFTER INSERT
  1306. ON "TagVariant"
  1307. FOR EACH ROW
  1308. BEGIN INSERT INTO TagVariantFts(docid, TagVariant_Text) VALUES(new.TagVariant_Id, new.TagVariant_Text); END;
  1309. CREATE TRIGGER "TagVariant_AfterUpdate"
  1310. AFTER UPDATE OF "TagVariant_Text"
  1311. ON "TagVariant"
  1312. FOR EACH ROW
  1313. BEGIN INSERT INTO TagVariantFts (docid, TagVariant_Text) VALUES(new.TagVariant_Id, new.TagVariant_Text) ; END;
  1314. CREATE TRIGGER "TagVariant_BeforeDelete"
  1315. BEFORE DELETE
  1316. ON "TagVariant"
  1317. FOR EACH ROW
  1318. BEGIN DELETE FROM TagVariantFts WHERE docid = old.TagVariant_Id; END;
  1319. CREATE TRIGGER "TagVariant_BeforeUpdate"
  1320. BEFORE UPDATE OF "TagVariant_Text"
  1321. ON "TagVariant"
  1322. FOR EACH ROW
  1323. BEGIN DELETE FROM TagVariantFts WHERE docid=old.TagVariant_Id; END;
  1324. -- ------------------------------------------
  1325. -- Dump of "TagVariantFts"
  1326. -- ------------------------------------------
  1327. -- Need to add atleast one column to create table 'TagVariantFts'
  1328. -- ------------------------------------------
  1329. -- Dump of "TagVariantFts_docsize"
  1330. -- ------------------------------------------
  1331. CREATE TABLE "TagVariantFts_docsize"(
  1332. "docid" Integer PRIMARY KEY,
  1333. "size" BLOB );
  1334. -- ------------------------------------------
  1335. -- Dump of "TagVariantFts_segdir"
  1336. -- ------------------------------------------
  1337. CREATE TABLE "TagVariantFts_segdir"(
  1338. "level" Integer,
  1339. "idx" Integer,
  1340. "start_block" Integer,
  1341. "leaves_end_block" Integer,
  1342. "end_block" Integer,
  1343. "root" BLOB,
  1344. PRIMARY KEY ( "level", "idx" ) );
  1345.  
  1346.  
  1347. -- ------------------------------------------
  1348. -- Dump of "TagVariantFts_segments"
  1349. -- ------------------------------------------
  1350. CREATE TABLE "TagVariantFts_segments"(
  1351. "blockid" Integer PRIMARY KEY,
  1352. "block" BLOB );
  1353.  
  1354. -- ------------------------------------------
  1355. -- Dump of "TagVariantFts_stat"
  1356. -- ------------------------------------------
  1357. CREATE TABLE "TagVariantFts_stat"(
  1358. "id" Integer PRIMARY KEY,
  1359. "value" BLOB );
  1360.  
  1361. -- ------------------------------------------
  1362. -- Dump of "UserActionAlbumView"
  1363. -- ------------------------------------------
  1364. CREATE TABLE "UserActionAlbumView"(
  1365. "UserActionAlbumView_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1366. "UserActionAlbumView_Date" Integer NOT NULL,
  1367. "UserActionAlbumView_AlbumId" Integer,
  1368. "UserActionAlbumView_ActionOrigin" Integer NOT NULL,
  1369. CONSTRAINT "UserActionAlbumView_Album_SET NULL_NO ACTION_UserActionAlbumView_AlbumId__0" FOREIGN KEY ( "UserActionAlbumView_AlbumId" ) REFERENCES "Album"
  1370. ON DELETE Set NULL
  1371. );
  1372. CREATE INDEX "UserActionAlbumView_AlbumId" ON "UserActionAlbumView"( "UserActionAlbumView_AlbumId" );
  1373. -- ------------------------------------------
  1374. -- Dump of "UserActionImport"
  1375. -- ------------------------------------------
  1376. CREATE TABLE "UserActionImport"(
  1377. "UserActionImport_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1378. "UserActionImport_Date" Integer NOT NULL,
  1379. "UserActionImport_SessionId" Integer NOT NULL,
  1380. "UserActionImport_Destination" Text NOT NULL,
  1381. "UserActionImport_ActionOrigin" Integer NOT NULL,
  1382. "UserActionImport_Manufacturer" Text NOT NULL,
  1383. "UserActionImport_Model" Text NOT NULL,
  1384. "UserActionImport_TotalCount" Integer NOT NULL );
  1385. -- ------------------------------------------
  1386. -- Dump of "UserActionLaunch"
  1387. -- ------------------------------------------
  1388. CREATE TABLE "UserActionLaunch"(
  1389. "UserActionLaunch_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1390. "UserActionLaunch_Date" Integer NOT NULL,
  1391. "UserActionLaunch_EntryPoint" Integer NOT NULL );
  1392.  
  1393.  
  1394. -- ------------------------------------------
  1395. -- Dump of "UserActionPrint"
  1396. -- ------------------------------------------
  1397. CREATE TABLE "UserActionPrint"(
  1398. "UserActionPrint_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1399. "UserActionPrint_Date" Integer NOT NULL,
  1400. "UserActionPrint_ItemId" Integer,
  1401. "UserActionPrint_ActionOrigin" Integer NOT NULL,
  1402. CONSTRAINT "UserActionPrint_Item_SET NULL_NO ACTION_UserActionPrint_ItemId__0" FOREIGN KEY ( "UserActionPrint_ItemId" ) REFERENCES "Item"
  1403. ON DELETE Set NULL
  1404. );
  1405. CREATE INDEX "UserActionPrint_ItemId" ON "UserActionPrint"( "UserActionPrint_ItemId" );
  1406. -- ------------------------------------------
  1407. -- Dump of "UserActionSearch"
  1408. -- ------------------------------------------
  1409. CREATE TABLE "UserActionSearch"(
  1410. "UserActionSearch_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1411. "UserActionSearch_Date" Integer NOT NULL,
  1412. "UserActionSearch_Json" Text NOT NULL,
  1413. "UserActionSearch_Textbox" Text NOT NULL,
  1414. "UserActionSearch_ActionOrigin" Integer NOT NULL,
  1415. "UserActionSearch_RequestOrigin" Integer NOT NULL,
  1416. "UserActionSearch_NumberOfResults" Integer NOT NULL,
  1417. "UserActionSearch_IndexingWasComplete" Integer NOT NULL );
  1418. -- ------------------------------------------
  1419. -- Dump of "UserActionShare"
  1420. -- ------------------------------------------
  1421. CREATE TABLE "UserActionShare"(
  1422. "UserActionShare_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1423. "UserActionShare_Date" Integer NOT NULL,
  1424. "UserActionShare_ItemId" Integer,
  1425. "UserActionShare_ActionOrigin" Integer NOT NULL,
  1426. "UserActionShare_Target" Text NOT NULL,
  1427. "UserActionShare_Result" Integer NOT NULL,
  1428. CONSTRAINT "UserActionShare_Item_SET NULL_NO ACTION_UserActionShare_ItemId__0" FOREIGN KEY ( "UserActionShare_ItemId" ) REFERENCES "Item"
  1429. ON DELETE Set NULL
  1430. );
  1431. CREATE INDEX "UserActionShare_ItemId" ON "UserActionShare"( "UserActionShare_ItemId" );
  1432. -- ------------------------------------------
  1433. -- Dump of "UserActionSlideshow"
  1434. -- ------------------------------------------
  1435. CREATE TABLE "UserActionSlideshow"(
  1436. "UserActionSlideshow_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1437. "UserActionSlideshow_Date" Integer NOT NULL,
  1438. "UserActionSlideshow_AlbumId" Integer,
  1439. "UserActionSlideshow_ItemId" Integer,
  1440. "UserActionSlideshow_ActionOrigin" Integer NOT NULL,
  1441. CONSTRAINT "UserActionSlideshow_Album_SET NULL_NO ACTION_UserActionSlideshow_AlbumId__0" FOREIGN KEY ( "UserActionSlideshow_AlbumId" ) REFERENCES "Album"
  1442. ON DELETE Set NULL
  1443. ,
  1444. CONSTRAINT "UserActionSlideshow_Item_SET NULL_NO ACTION_UserActionSlideshow_ItemId__0" FOREIGN KEY ( "UserActionSlideshow_ItemId" ) REFERENCES "Item"
  1445. ON DELETE Set NULL
  1446. );
  1447. CREATE INDEX "UserActionSlideshow_AlbumId" ON "UserActionSlideshow"( "UserActionSlideshow_AlbumId" );
  1448. CREATE INDEX "UserActionSlideshow_ItemId" ON "UserActionSlideshow"( "UserActionSlideshow_ItemId" );
  1449. -- ------------------------------------------
  1450. -- Dump of "UserActionView"
  1451. -- ------------------------------------------
  1452. CREATE TABLE "UserActionView"(
  1453. "UserActionView_Id" Integer PRIMARY KEY AUTOINCREMENT,
  1454. "UserActionView_Date" Integer NOT NULL,
  1455. "UserActionView_ItemId" Integer,
  1456. "UserActionView_ActionOrigin" Integer NOT NULL,
  1457. CONSTRAINT "UserActionView_Item_SET NULL_NO ACTION_UserActionView_ItemId__0" FOREIGN KEY ( "UserActionView_ItemId" ) REFERENCES "Item"
  1458. ON DELETE Set NULL
  1459. );
  1460. CREATE INDEX "UserActionView_ItemId" ON "UserActionView"( "UserActionView_ItemId" );
  1461.  
  1462.  
  1463. -- ------------------------------------------
  1464. -- Dump of "VideoFaceOccurrence"
  1465. -- ------------------------------------------
  1466. CREATE TABLE "VideoFaceOccurrence"(
  1467. "VideoFaceOccurrence_Id" Integer PRIMARY KEY );
  1468. CREATE VIEW OCRItemTextView AS SELECT rowid, group_concat(OCRLine_Text, ' ') AS OCRItemTextView_Text FROM ( SELECT rowid, OCRItem_ItemId, OCRItem_Id, OCRLine_Id, group_concat(OCRWord_Text, ' ') AS OCRLine_Text FROM ( SELECT OCRItem.OCRItem_ItemId AS rowid, OCRItem_ItemId, OCRItem_Id, OCRLine_IndexOnItem, OCRLine_Id, OCRWord_Text FROM OCRItem JOIN OCRLine ON OCRItem_Id = OCRLine_OCRItemId JOIN OCRWord ON OCRWord_OCRLineId = OCRLine_Id ORDER BY OCRItem_ItemId, OCRLine_IndexOnItem, OCRWord_IndexOnLine ) GROUP BY OCRLine_Id ) GROUP BY OCRItem_Id;
Advertisement
Add Comment
Please, Sign In to add comment