comparison OrthancServer/Database/Upgrade3To4.sql @ 3094:61da3c9b4121 db-changes

cont reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 05 Jan 2019 17:52:24 +0100
parents OrthancServer/Upgrade3To4.sql@72dc919a028c
children
comparison
equal deleted inserted replaced
3093:2e1808b6146a 3094:61da3c9b4121
1 -- This SQLite script updates the version of the Orthanc database from 3 to 4.
2
3 -- Add 2 new columns at "AttachedFiles"
4
5 ALTER TABLE AttachedFiles ADD COLUMN uncompressedMD5 TEXT;
6 ALTER TABLE AttachedFiles ADD COLUMN compressedMD5 TEXT;
7
8 -- Update the "AttachedFileDeleted" trigger
9
10 DROP TRIGGER AttachedFileDeleted;
11
12 CREATE TRIGGER AttachedFileDeleted
13 AFTER DELETE ON AttachedFiles
14 BEGIN
15 SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize,
16 old.compressionType, old.compressedSize,
17 -- These 2 arguments are new in Orthanc 0.7.3 (database v4)
18 old.uncompressedMD5, old.compressedMD5);
19 END;
20
21 -- Change the database version
22 -- The "1" corresponds to the "GlobalProperty_DatabaseSchemaVersion" enumeration
23
24 UPDATE GlobalProperties SET value="4" WHERE property=1;