view PostgreSQL/Plugins/SQL/Downgrades/Rev3ToRev2.sql @ 598:8f6e7ae942f3 find-refactoring

DB Housekeeping
author Alain Mazy <am@orthanc.team>
date Wed, 27 Nov 2024 16:05:49 +0100
parents 272eeb046a88
children
line wrap: on
line source

-- This file contains an SQL procedure to downgrade from schema Rev3 to Rev2 (version = 6, revision = 1).
  -- It actually deletes the ChildCount table and triggers
  -- It actually does not uninstall ChildrenIndex2 because it is anyway more efficient than 
     -- ChildrenIndex and is not incompatible with previous revisions.

DROP TRIGGER IF EXISTS DecrementChildCount ON Resources;
DROP TRIGGER IF EXISTS IncrementChildCount ON Resources;
DROP TABLE ChildCount;
DROP FUNCTION UpdateChildCount;


-- set the global properties that actually documents the DB version, revision and some of the capabilities
-- modify only the ones that have changed
DELETE FROM GlobalProperties WHERE property IN (4, 11);
INSERT INTO GlobalProperties VALUES (4, 2); -- GlobalProperty_DatabasePatchLevel