Mercurial > hg > orthanc
diff OrthancServer/Sources/Database/PrepareDatabase.sql @ 5084:9770d537880d attach-custom-data
added support for revision in SQLite + avoid upgrading DB version
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 15 Sep 2022 09:02:07 +0200 |
parents | d7274e43ea7c |
children |
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/PrepareDatabase.sql Wed Sep 14 17:11:45 2022 +0200 +++ b/OrthancServer/Sources/Database/PrepareDatabase.sql Thu Sep 15 09:02:07 2022 +0200 @@ -51,6 +51,7 @@ id INTEGER REFERENCES Resources(internalId) ON DELETE CASCADE, type INTEGER, value TEXT, + -- revision INTEGER, -- New in Orthanc 1.12.0 (added in InstallRevisionAndCustomData.sql) PRIMARY KEY(id, type) ); @@ -63,7 +64,8 @@ compressionType INTEGER, uncompressedMD5 TEXT, -- New in Orthanc 0.7.3 (database v4) compressedMD5 TEXT, -- New in Orthanc 0.7.3 (database v4) - customData TEXT, -- New in Orthanc 1.12.0 (database v7) + -- revision INTEGER, -- New in Orthanc 1.12.0 (added in InstallRevisionAndCustomData.sql) + -- customData TEXT, -- New in Orthanc 1.12.0 (added in InstallRevisionAndCustomData.sql) PRIMARY KEY(id, fileType) ); @@ -115,9 +117,8 @@ SELECT SignalFileDeleted(old.uuid, old.fileType, old.uncompressedSize, old.compressionType, old.compressedSize, -- These 2 arguments are new in Orthanc 0.7.3 (database v4) - old.uncompressedMD5, old.compressedMD5, - -- customData is new in Orthanc 1.12.0 (database v7) - old.customData); + old.uncompressedMD5, old.compressedMD5 + ); END; CREATE TRIGGER ResourceDeleted @@ -146,4 +147,4 @@ -- Set the version of the database schema -- The "1" corresponds to the "GlobalProperty_DatabaseSchemaVersion" enumeration -INSERT INTO GlobalProperties VALUES (1, "7"); +INSERT INTO GlobalProperties VALUES (1, "6");