comparison OrthancServer/Sources/Database/Upgrade3To4.sql @ 4044:d25f4c0fa160 framework

splitting code into OrthancFramework and OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 20:30:34 +0200
parents OrthancServer/Database/Upgrade3To4.sql@61da3c9b4121
children 28944db5318b
comparison
equal deleted inserted replaced
4043:6c6239aec462 4044:d25f4c0fa160
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;