Skip to content

Commit

Permalink
add schema version reversion to db reversion & rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Büßemeyer authored and Michael Büßemeyer committed Dec 6, 2024
1 parent 3fd9ef6 commit 6149a05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ UPDATE webknossos.annotation_layers SET name = regexp_replace(name, '\$', '', 'g
ALTER TABLE webknossos.annotation_layers DROP CONSTRAINT IF EXISTS annotation_layers_name_check;
ALTER TABLE webknossos.annotation_layers ADD CONSTRAINT annotation_layers_name_check CHECK (name ~* '^[A-Za-z0-9\-_\.]+$');

UPDATE webknossos.releaseInformation SET schemaVersion = 124;

COMMIT TRANSACTION;
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export function checkLayerNameForInvalidCharacters(readableLayerName: string): V
message: messages["tracing.volume_layer_name_starts_with_dot"],
};
}
const uriSafeCharactersRegex = /[0-9a-zA-Z-._$]+/g;
const validLayerNameCharactersRegex = /[0-9a-zA-Z-._$]+/g;
// Removing all URISaveCharacters from readableLayerName. The leftover chars are all invalid.
const allInvalidChars = readableLayerName.replace(uriSafeCharactersRegex, "");
const allInvalidChars = readableLayerName.replace(validLayerNameCharactersRegex, "");
const allUniqueInvalidCharsAsSet = new Set(allInvalidChars);
const allUniqueInvalidCharsAsString = "".concat(...allUniqueInvalidCharsAsSet.values());
const isValid = allUniqueInvalidCharsAsString.length === 0;
Expand Down

0 comments on commit 6149a05

Please sign in to comment.