Skip to content

Remove stored meshes feature from backend and postgres #8554

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 6 commits into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions MIGRATIONS.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ User-facing changes are documented in the [changelog](CHANGELOG.released.md).
[Commits](https://github.com/scalableminds/webknossos/compare/25.05.0...HEAD)

### Postgres Evolutions:
<<<<<<< HEAD

Comment on lines +12 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I’ll repair it in #8559

- [131-more-indices-on-users.sql](conf/evolutions/131-more-indices-on-users.sql)
- [132-remove-stored-meshes.sql](conf/evolutions/132-remove-stored-meshes.sql)
83 changes: 0 additions & 83 deletions app/controllers/MeshController.scala

This file was deleted.

125 changes: 0 additions & 125 deletions app/models/mesh/Mesh.scala

This file was deleted.

6 changes: 6 additions & 0 deletions conf/evolutions/132-remove-stored-meshes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
do $$ begin ASSERT (select schemaVersion from webknossos.releaseInformation) = 131, 'Previous schema version mismatch'; end; $$ LANGUAGE plpgsql;

DROP VIEW webknossos.meshes_;
DROP TABLE webknossos.meshes;

UPDATE webknossos.releaseInformation SET schemaVersion = 132;
19 changes: 19 additions & 0 deletions conf/evolutions/reversions/132-remove-stored-meshes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
do $$ begin ASSERT (select schemaVersion from webknossos.releaseInformation) = 132, 'Previous schema version mismatch'; end; $$ LANGUAGE plpgsql;


CREATE TABLE webknossos.meshes(
_id TEXT CONSTRAINT _id_objectId CHECK (_id ~ '^[0-9a-f]{24}$') PRIMARY KEY,
_annotation TEXT CONSTRAINT _annotation_objectId CHECK (_annotation ~ '^[0-9a-f]{24}$') NOT NULL,
description TEXT NOT NULL DEFAULT '',
position webknossos.VECTOR3 NOT NULL,
data TEXT,
created TIMESTAMPTZ NOT NULL DEFAULT NOW(),
isDeleted BOOLEAN NOT NULL DEFAULT false
);

CREATE VIEW webknossos.meshes_ AS SELECT * FROM webknossos.meshes WHERE NOT isDeleted;

ALTER TABLE webknossos.meshes
ADD CONSTRAINT annotation_ref FOREIGN KEY(_annotation) REFERENCES webknossos.annotations(_id) DEFERRABLE;

UPDATE webknossos.releaseInformation SET schemaVersion = 131;
10 changes: 0 additions & 10 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -260,19 +260,9 @@ annotation.editableMapping.getAgglomerateGraph.failed=Could not look up an agglo
annotation.editableMapping.getAgglomerateIdsForSegments.failed=Could not look up agglomerate ids for requested segments.
annotation.duplicate.failed=Failed to duplicate annotation

mesh.notFound=Mesh could not be found
mesh.write.failed=Failed to convert mesh info to json
mesh.create.failed=Failed to save mesh info
mesh.update.failed=Failed to update mesh info
mesh.data.get.failed=Failed to load mesh raw data
mesh.data.read.failed=Failed to convert mesh raw data for saving
mesh.data.save.failed=Failed to save mesh raw data
mesh.delete.failed=Failed to delete mesh
mesh.file.load.failed=Failed to load mesh for segment {0}
mesh.file.listChunks.failed=Failed to load chunk list for segment {0} from mesh file “{1}”
mesh.file.loadChunk.failed=Failed to load mesh chunk for segment
mesh.file.open.failed=Failed to open mesh file for reading
mesh.file.readData.failed=Failed to read data from mesh file
mesh.file.readEncoding.failed=Failed to read encoding from mesh file

task.create.noTasks=Zero tasks were requested
Expand Down
8 changes: 0 additions & 8 deletions conf/webknossos.latest.routes
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,6 @@ PUT /zarrPrivateLinks/:id
DELETE /zarrPrivateLinks/:id controllers.AnnotationPrivateLinkController.delete(id: ObjectId)
GET /zarrPrivateLinks/:id controllers.AnnotationPrivateLinkController.get(id: ObjectId)

# Meshes
POST /meshes controllers.MeshController.create()
PUT /meshes/:id controllers.MeshController.update(id: ObjectId)
DELETE /meshes/:id controllers.MeshController.delete(id: ObjectId)
GET /meshes/:id controllers.MeshController.get(id: ObjectId)
PUT /meshes/:id/data controllers.MeshController.updateData(id: ObjectId)
GET /meshes/:id/data controllers.MeshController.getData(id: ObjectId)

# Tasks
POST /tasks controllers.TaskController.create()
POST /tasks/createFromFiles controllers.TaskController.createFromFiles()
Expand Down
15 changes: 1 addition & 14 deletions tools/postgres/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CREATE TABLE webknossos.releaseInformation (
schemaVersion BIGINT NOT NULL
);

INSERT INTO webknossos.releaseInformation(schemaVersion) values(131);
INSERT INTO webknossos.releaseInformation(schemaVersion) values(132);
COMMIT TRANSACTION;


Expand Down Expand Up @@ -82,16 +82,6 @@ CREATE TABLE webknossos.annotation_mutexes(
expiry TIMESTAMP NOT NULL
);

CREATE TABLE webknossos.meshes(
_id TEXT CONSTRAINT _id_objectId CHECK (_id ~ '^[0-9a-f]{24}$') PRIMARY KEY,
_annotation TEXT CONSTRAINT _annotation_objectId CHECK (_annotation ~ '^[0-9a-f]{24}$') NOT NULL,
description TEXT NOT NULL DEFAULT '',
position webknossos.VECTOR3 NOT NULL,
data TEXT,
created TIMESTAMPTZ NOT NULL DEFAULT NOW(),
isDeleted BOOLEAN NOT NULL DEFAULT FALSE
);

CREATE TABLE webknossos.publications(
_id TEXT PRIMARY KEY,
publicationDate TIMESTAMPTZ,
Expand Down Expand Up @@ -740,7 +730,6 @@ CREATE TABLE webknossos.analyticsEvents(


CREATE VIEW webknossos.annotations_ AS SELECT * FROM webknossos.annotations WHERE NOT isDeleted;
CREATE VIEW webknossos.meshes_ AS SELECT * FROM webknossos.meshes WHERE NOT isDeleted;
CREATE VIEW webknossos.publications_ AS SELECT * FROM webknossos.publications WHERE NOT isDeleted;
CREATE VIEW webknossos.datasets_ AS SELECT * FROM webknossos.datasets WHERE NOT isDeleted;
CREATE VIEW webknossos.dataStores_ AS SELECT * FROM webknossos.dataStores WHERE NOT isDeleted;
Expand Down Expand Up @@ -823,8 +812,6 @@ ALTER TABLE webknossos.annotation_contributors
ALTER TABLE webknossos.annotation_mutexes
ADD CONSTRAINT annotation_ref FOREIGN KEY(_annotation) REFERENCES webknossos.annotations(_id) ON DELETE CASCADE DEFERRABLE,
ADD CONSTRAINT user_ref FOREIGN KEY(_user) REFERENCES webknossos.users(_id) ON DELETE CASCADE DEFERRABLE;
ALTER TABLE webknossos.meshes
ADD CONSTRAINT annotation_ref FOREIGN KEY(_annotation) REFERENCES webknossos.annotations(_id) DEFERRABLE;
ALTER TABLE webknossos.datasets
ADD CONSTRAINT organization_ref FOREIGN KEY(_organization) REFERENCES webknossos.organizations(_id) DEFERRABLE,
ADD CONSTRAINT dataStore_ref FOREIGN KEY(_dataStore) REFERENCES webknossos.dataStores(name) DEFERRABLE,
Expand Down
Loading