Skip to content
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

Make Project and TaskType names unique by Organization #5334

Merged
merged 16 commits into from
Apr 8, 2021

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Mar 24, 2021

Project and TaskType names had to be globally unique. Now, they are uniqe per organization.

TODO

  • change unique constraints in schema
  • add organization during insert
  • change project api (by orga+name/by id/by disambiguation)?
  • change edit view route
  • use new api in frontend
  • adapt task search form
  • task search form persistence? → follow-up Double-Check that localstorage persistence typechecks work #5337
  • how to access project name for rendering form?
  • adapt access queries
  • rest api versioning
  • evolutions
  • snapshot tests

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • List projects, create project, edit project, should all still work as expected
  • Create tasks, search for tasks by project, should show.
  • Try to create second project with the same name, should fail with readable message.
  • Create second organization
  • Create project with name used in other org, should work
  • Edit projects, the ones across organizations should not influence each other
  • same with task types.

Issues:


@fm3 fm3 marked this pull request as ready for review March 24, 2021 13:54
@fm3 fm3 changed the title [WIP] Make Project and TaskType names unique by Organization Make Project and TaskType names unique by Organization Mar 24, 2021
@fm3 fm3 requested review from youri-k and philippotto March 24, 2021 13:55
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Great work! The front-end changes look very good 👍 Let's wait for the back-end review.

Copy link
Contributor

@youri-k youri-k left a comment

Choose a reason for hiding this comment

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

The code LGTM. See my minor question.

The other thing that should be checked is if we need all the indices in the db because AFAIK postgresql automatically creates indices for unique constraints, e.g. https://github.com/scalableminds/webknossos/blob/project-tasktype-unique-by-orga/tools/postgres/schema.sql#L432

app/models/mesh/Mesh.scala Show resolved Hide resolved
@fm3 fm3 merged commit d06b56f into master Apr 8, 2021
@fm3 fm3 deleted the project-tasktype-unique-by-orga branch April 8, 2021 07:11
fm3 added a commit that referenced this pull request Apr 8, 2021
fm3 added a commit that referenced this pull request Apr 8, 2021
fm3 added a commit that referenced this pull request Apr 8, 2021
@fm3 fm3 restored the project-tasktype-unique-by-orga branch April 12, 2021 11:38
fm3 added a commit that referenced this pull request Apr 15, 2021
…5381)

* Revert "Revert "Make Project and TaskType names unique by Organization (#5334)" (#5379)"

This reverts commit 9f3b48c.

* Enforce project name uniqueness only in scala

* fix sql comment syntax

* update sql reversion
@fm3 fm3 deleted the project-tasktype-unique-by-orga branch May 3, 2021 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Project/Task type names names should not have to be unique across all organizations
3 participants