diff OrthancServer/PrepareDatabase.sql @ 1709:2ad22b2970a2 db-changes

SearchableStudies
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 13 Oct 2015 17:48:30 +0200
parents de1413733c97
children 5ebd6cbb3da8
line wrap: on
line diff
--- a/OrthancServer/PrepareDatabase.sql	Tue Oct 13 16:57:55 2015 +0200
+++ b/OrthancServer/PrepareDatabase.sql	Tue Oct 13 17:48:30 2015 +0200
@@ -27,6 +27,15 @@
        PRIMARY KEY(id, tagGroup, tagElement)
        );
 
+-- The following table was added in Orthanc 0.9.5 (database v6)
+CREATE TABLE SearchableStudies(
+       id INTEGER REFERENCES Resources(internalId) ON DELETE CASCADE,
+       tagGroup INTEGER,
+       tagElement INTEGER,
+       value TEXT,  -- assumed to be in upper case
+       PRIMARY KEY(id, tagGroup, tagElement)
+       );
+
 CREATE TABLE Metadata(
        id INTEGER REFERENCES Resources(internalId) ON DELETE CASCADE,
        type INTEGER,
@@ -86,6 +95,10 @@
 CREATE INDEX DicomIdentifiersIndex2 ON DicomIdentifiers(tagGroup, tagElement);
 CREATE INDEX DicomIdentifiersIndexValues ON DicomIdentifiers(value COLLATE BINARY);
 
+-- The 2 following indexes were added in Orthanc 0.9.5 (database v6)
+CREATE INDEX SearchableStudiesIndex1 ON SearchableStudies(id);
+CREATE INDEX SearchableStudiesIndexValues ON SearchableStudies(value COLLATE BINARY);
+
 CREATE INDEX ChangesIndex ON Changes(internalId);
 
 CREATE TRIGGER AttachedFileDeleted