forked from scalableminds/webknossos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path101-coordinate-transformations.sql
51 lines (44 loc) · 1.6 KB
/
101-coordinate-transformations.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
START TRANSACTION;
CREATE TABLE webknossos.dataSet_layer_coordinateTransformations(
_dataSet CHAR(24) NOT NULL,
layerName VARCHAR(256) NOT NULL,
type VARCHAR(256) NOT NULL,
matrix JSONB
);
ALTER TABLE webknossos.dataSet_layer_coordinateTransformations
ADD CONSTRAINT dataSet_ref FOREIGN KEY(_dataSet) REFERENCES webknossos.dataSets(_id) DEFERRABLE;
-- Update default gpuMemoryFactor from 3 to 4 in user configuration
UPDATE webknossos.users
SET userconfiguration = CASE
WHEN (userconfiguration->>'gpuMemoryFactor')::NUMERIC = 3 THEN jsonb_set(
userconfiguration,
array['gpuMemoryFactor'],
to_jsonb(4::NUMERIC))
else
userconfiguration
END
WHERE userconfiguration ? 'gpuMemoryFactor';
-- Do the same for recommended configurations of task types
UPDATE webknossos.tasktypes
SET recommendedconfiguration = CASE
WHEN (recommendedconfiguration->>'gpuMemoryFactor')::NUMERIC = 3 THEN jsonb_set(
recommendedconfiguration,
array['gpuMemoryFactor'],
to_jsonb(4::NUMERIC))
else
recommendedconfiguration
END
WHERE recommendedconfiguration ? 'gpuMemoryFactor';
-- Disable interpolation for all users for performance reasons.
UPDATE webknossos.user_dataSetConfigurations
SET viewconfiguration = CASE
WHEN jsonb_typeof(viewconfiguration->'interpolation') = 'boolean' AND (viewconfiguration->>'interpolation')::boolean IS TRUE THEN jsonb_set(
viewconfiguration,
array['interpolation'],
to_jsonb(FALSE))
else
viewconfiguration
END
WHERE viewconfiguration ? 'interpolation';
UPDATE webknossos.releaseInformation SET schemaVersion = 101;
COMMIT TRANSACTION;