Mercurial > hg > orthanc
comparison OrthancServer/Sources/Database/DowngradeFrom7to6.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 | |
children |
comparison
equal
deleted
inserted
replaced
5079:4366b4c41441 | 5080:d7274e43ea7c |
---|---|
1 -- Orthanc - A Lightweight, RESTful DICOM Store | |
2 -- Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
3 -- Department, University Hospital of Liege, Belgium | |
4 -- Copyright (C) 2017-2022 Osimis S.A., Belgium | |
5 -- Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
6 -- | |
7 -- This program is free software: you can redistribute it and/or | |
8 -- modify it under the terms of the GNU General Public License as | |
9 -- published by the Free Software Foundation, either version 3 of the | |
10 -- License, or (at your option) any later version. | |
11 -- | |
12 -- This program is distributed in the hope that it will be useful, but | |
13 -- WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 -- General Public License for more details. | |
16 -- | |
17 -- You should have received a copy of the GNU General Public License | |
18 -- along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | |
20 | |
21 -- | |
22 -- This SQLite script updates the version of the Orthanc database from 6 to 7. | |
23 -- | |
24 | |
25 -- Add a new column to AttachedFiles | |
26 | |
27 ALTER TABLE AttachedFiles DROP COLUMN metadata; | |
28 | |
29 -- update the triggers (back to v6) | |
30 DROP TRIGGER AttachedFileDeleted | |
31 | |
32 CREATE TRIGGER AttachedFileDeleted | |
33 AFTER DELETE ON AttachedFiles | |
34 BEGIN | |
35 SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize, | |
36 old.compressionType, old.compressedSize, | |
37 old.uncompressedMD5, old.compressedMD5); | |
38 END; | |
39 | |
40 | |
41 -- Change the database version | |
42 -- The "1" corresponds to the "GlobalProperty_DatabaseSchemaVersion" enumeration | |
43 | |
44 UPDATE GlobalProperties SET value="6" WHERE property=1; | |
45 |