comparison OrthancServer/Sources/Database/PrepareDatabase.sql @ 5080:d7274e43ea7c attach-custom-data

allow plugins to store a customData in the Attachments table to e.g. store custom paths without requiring an external DB
author Alain Mazy <am@osimis.io>
date Thu, 08 Sep 2022 17:42:08 +0200
parents 6eff25f70121
children 9770d537880d
comparison
equal deleted inserted replaced
5079:4366b4c41441 5080:d7274e43ea7c
61 compressedSize INTEGER, 61 compressedSize INTEGER,
62 uncompressedSize INTEGER, 62 uncompressedSize INTEGER,
63 compressionType INTEGER, 63 compressionType INTEGER,
64 uncompressedMD5 TEXT, -- New in Orthanc 0.7.3 (database v4) 64 uncompressedMD5 TEXT, -- New in Orthanc 0.7.3 (database v4)
65 compressedMD5 TEXT, -- New in Orthanc 0.7.3 (database v4) 65 compressedMD5 TEXT, -- New in Orthanc 0.7.3 (database v4)
66 customData TEXT, -- New in Orthanc 1.12.0 (database v7)
66 PRIMARY KEY(id, fileType) 67 PRIMARY KEY(id, fileType)
67 ); 68 );
68 69
69 CREATE TABLE Changes( 70 CREATE TABLE Changes(
70 seq INTEGER PRIMARY KEY AUTOINCREMENT, 71 seq INTEGER PRIMARY KEY AUTOINCREMENT,
112 AFTER DELETE ON AttachedFiles 113 AFTER DELETE ON AttachedFiles
113 BEGIN 114 BEGIN
114 SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize, 115 SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize,
115 old.compressionType, old.compressedSize, 116 old.compressionType, old.compressedSize,
116 -- These 2 arguments are new in Orthanc 0.7.3 (database v4) 117 -- These 2 arguments are new in Orthanc 0.7.3 (database v4)
117 old.uncompressedMD5, old.compressedMD5); 118 old.uncompressedMD5, old.compressedMD5,
119 -- customData is new in Orthanc 1.12.0 (database v7)
120 old.customData);
118 END; 121 END;
119 122
120 CREATE TRIGGER ResourceDeleted 123 CREATE TRIGGER ResourceDeleted
121 AFTER DELETE ON Resources 124 AFTER DELETE ON Resources
122 BEGIN 125 BEGIN
141 END; 144 END;
142 145
143 146
144 -- Set the version of the database schema 147 -- Set the version of the database schema
145 -- The "1" corresponds to the "GlobalProperty_DatabaseSchemaVersion" enumeration 148 -- The "1" corresponds to the "GlobalProperty_DatabaseSchemaVersion" enumeration
146 INSERT INTO GlobalProperties VALUES (1, "6"); 149 INSERT INTO GlobalProperties VALUES (1, "7");