comparison OrthancServer/Sources/Database/PrepareDatabase.sql @ 5227:988dab8deb1c db-protobuf

"/tools/find" accepts the "WithLabels" and "WithoutLabels" arguments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Apr 2023 09:16:12 +0200
parents d0f7c742d397
children 261ce0ed85e6
comparison
equal deleted inserted replaced
5226:49e906a8fea2 5227:988dab8deb1c
92 ); 92 );
93 93
94 -- New in Orthanc 1.12.0 94 -- New in Orthanc 1.12.0
95 CREATE TABLE Labels( 95 CREATE TABLE Labels(
96 internalId INTEGER REFERENCES Resources(internalId) ON DELETE CASCADE, 96 internalId INTEGER REFERENCES Resources(internalId) ON DELETE CASCADE,
97 label TEXT 97 label TEXT NOT NULL,
98 PRIMARY KEY(internalId, label) -- Prevents duplicates
98 ); 99 );
99 100
100 CREATE INDEX ChildrenIndex ON Resources(parentId); 101 CREATE INDEX ChildrenIndex ON Resources(parentId);
101 CREATE INDEX PublicIndex ON Resources(publicId); 102 CREATE INDEX PublicIndex ON Resources(publicId);
102 CREATE INDEX ResourceTypeIndex ON Resources(resourceType); 103 CREATE INDEX ResourceTypeIndex ON Resources(resourceType);
111 CREATE INDEX DicomIdentifiersIndex1 ON DicomIdentifiers(id); 112 CREATE INDEX DicomIdentifiersIndex1 ON DicomIdentifiers(id);
112 CREATE INDEX DicomIdentifiersIndex2 ON DicomIdentifiers(tagGroup, tagElement); 113 CREATE INDEX DicomIdentifiersIndex2 ON DicomIdentifiers(tagGroup, tagElement);
113 CREATE INDEX DicomIdentifiersIndexValues ON DicomIdentifiers(value COLLATE BINARY); 114 CREATE INDEX DicomIdentifiersIndexValues ON DicomIdentifiers(value COLLATE BINARY);
114 115
115 CREATE INDEX ChangesIndex ON Changes(internalId); 116 CREATE INDEX ChangesIndex ON Changes(internalId);
117
118 -- New in Orthanc 1.12.0
119 CREATE INDEX LabelsIndex1 ON Labels(internalId);
120 CREATE INDEX LabelsIndex2 ON Labels(label); -- This index allows efficient lookups
116 121
117 CREATE TRIGGER AttachedFileDeleted 122 CREATE TRIGGER AttachedFileDeleted
118 AFTER DELETE ON AttachedFiles 123 AFTER DELETE ON AttachedFiles
119 BEGIN 124 BEGIN
120 SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize, 125 SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize,