1709
|
1 -- This SQLite script updates the version of the Orthanc database from 5 to 6.
|
|
2
|
|
3
|
|
4 -- Add a new table to enable full-text indexed search over studies
|
|
5
|
|
6 CREATE TABLE SearchableStudies(
|
|
7 id INTEGER REFERENCES Resources(internalId) ON DELETE CASCADE,
|
|
8 tagGroup INTEGER,
|
|
9 tagElement INTEGER,
|
|
10 value TEXT, -- assumed to be in upper case
|
|
11 PRIMARY KEY(id, tagGroup, tagElement)
|
|
12 );
|
|
13
|
|
14 CREATE INDEX SearchableStudiesIndex1 ON SearchableStudies(id);
|
|
15 CREATE INDEX SearchableStudiesIndexValues ON SearchableStudies(value COLLATE BINARY);
|
|
16
|
|
17
|
|
18 -- Change the database version
|
|
19 -- The "1" corresponds to the "GlobalProperty_DatabaseSchemaVersion" enumeration
|
|
20
|
|
21 UPDATE GlobalProperties SET value="6" WHERE property=1;
|