-
Notifications
You must be signed in to change notification settings - Fork 29
Store dataset properties in DB #8609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
35205cc
Store dataset properties in DB
frcroth e2b00de
Merge branch 'master' into dataset-properties-in-db
frcroth 8f19277
Bump evolution number
frcroth 5200450
Update MIGRATIONS
frcroth d6231e4
Update test db
frcroth 28144e2
Merge branch 'master' into dataset-properties-in-db
frcroth ef841ea
Datalayer format as enum
frcroth b3a31d5
Use JSON in db instead of string serialization
frcroth 636aa8a
Merge branch 'master' into dataset-properties-in-db
frcroth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
START TRANSACTION; | ||
|
||
do $$ begin ASSERT (select schemaVersion from webknossos.releaseInformation) = 132, 'Previous schema version mismatch'; end; $$ LANGUAGE plpgsql; | ||
|
||
-- The aim of this migration is to have all properties of datasources that are saved in the datasource-properties.json | ||
-- file saved in the database. | ||
|
||
CREATE TYPE webknossos.DATASET_LAYER_DATAFORMAT AS ENUM ('wkw','zarr','zarr3','n5','neuroglancerPrecomputed'); | ||
|
||
ALTER TABLE webknossos.dataset_layers | ||
ADD COLUMN IF NOT EXISTS numChannels INT, | ||
ADD COLUMN IF NOT EXISTS dataFormat webknossos.DATASET_LAYER_DATAFORMAT; | ||
|
||
ALTER TABLE webknossos.dataset_mags | ||
ADD COLUMN IF NOT EXISTS credentialId TEXT, | ||
ADD COLUMN IF NOT EXISTS axisOrder JSONB CONSTRAINT axisOrder_requiredKeys CHECK (axisOrder ? 'x' AND axisOrder ? 'y'), | ||
ADD COLUMN IF NOT EXISTS channelIndex INT, | ||
ADD COLUMN IF NOT EXISTS cubeLength INT; | ||
-- legacy credentials omitted | ||
|
||
UPDATE webknossos.releaseInformation SET schemaVersion = 133; | ||
|
||
COMMIT TRANSACTION; |
19 changes: 19 additions & 0 deletions
19
conf/evolutions/reversions/133-datasource-properties-in-db.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
START TRANSACTION; | ||
|
||
do $$ begin ASSERT (select schemaVersion from webknossos.releaseInformation) = 133, 'Previous schema version mismatch'; end; $$ LANGUAGE plpgsql; | ||
|
||
ALTER TABLE webknossos.dataset_layers | ||
DROP COLUMN IF EXISTS numChannels, | ||
DROP COLUMN IF EXISTS dataFormat; | ||
|
||
DROP TYPE IF EXISTS webknossos.DATASET_LAYER_DATAFORMAT; | ||
|
||
ALTER TABLE webknossos.dataset_mags | ||
DROP COLUMN IF EXISTS credentialId, | ||
DROP COLUMN IF EXISTS axisOrder, | ||
DROP COLUMN IF EXISTS channelIndex, | ||
DROP COLUMN IF EXISTS cubeLength; | ||
|
||
UPDATE webknossos.releaseInformation SET schemaVersion = 132; | ||
|
||
COMMIT TRANSACTION; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
_dataSet,name,category,elementClass,boundingBox,largestSegmentId,mappings,defaultViewConfiguration,adminViewConfiguration | ||
'59e9cfbdba632ac2ab8b23b3','color_1','color','uint8','(0,0,0,512,512,256)',,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_2','color','uint8','(0,0,0,512,512,256)',,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_3','color','uint8','(0,0,0,512,512,256)',,,, | ||
'59e9cfbdba632ac2ab8b23b5','color','color','uint8','(3072,3072,512,1024,1024,1024)',,,, | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','segmentation','uint32','(3072,3072,512,1024,1024,1024)',2504697,'{}',, | ||
_dataSet,name,category,elementClass,boundingBox,largestSegmentId,mappings,defaultViewConfiguration,adminViewConfiguration,numChannels,dataFormat | ||
'59e9cfbdba632ac2ab8b23b3','color_1','color','uint8','(0,0,0,512,512,256)',,,,,,wkw | ||
'59e9cfbdba632ac2ab8b23b3','color_2','color','uint8','(0,0,0,512,512,256)',,,,,,wkw | ||
'59e9cfbdba632ac2ab8b23b3','color_3','color','uint8','(0,0,0,512,512,256)',,,,,,wkw | ||
'59e9cfbdba632ac2ab8b23b5','color','color','uint8','(3072,3072,512,1024,1024,1024)',,,,,,wkw | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','segmentation','uint32','(3072,3072,512,1024,1024,1024)',2504697,'{}',,,,wkw |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
_dataSet,dataLayerName,mag,scale,path,realPath,hasLocalData | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(1,1,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(2,2,2)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(4,4,4)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(8,8,8)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(16,16,16)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(1,1,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(2,2,2)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(4,4,4)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(8,8,8)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(16,16,16)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(1,1,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(2,2,2)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(4,4,4)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(8,8,8)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(16,16,16)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','color','(1,1,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','color','(2,2,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','color','(4,4,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','color','(8,8,2)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','color','(16,16,4)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(1,1,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(2,2,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(4,4,1)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(8,8,2)','uninitialized','uninitialized',false | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(16,16,4)','uninitialized','uninitialized',false | ||
_dataSet,dataLayerName,mag,scale,path,realPath,hasLocalData,channelIndex,cubeLength,credentialId | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(1,1,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(2,2,2)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(4,4,4)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(8,8,8)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_1','(16,16,16)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(1,1,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(2,2,2)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(4,4,4)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(8,8,8)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_2','(16,16,16)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(1,1,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(2,2,2)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(4,4,4)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(8,8,8)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b3','color_3','(16,16,16)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','color','(1,1,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','color','(2,2,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','color','(4,4,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','color','(8,8,2)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','color','(16,16,4)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(1,1,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(2,2,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(4,4,1)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(8,8,2)','uninitialized','uninitialized',false,,,, | ||
'59e9cfbdba632ac2ab8b23b5','segmentation','(16,16,4)','uninitialized','uninitialized',false,,,, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for also adding the missing
adminViewConfiguration
update