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

Allow forcing uniqueness for any field in schema configuration #2712

Closed
grantfitzsimmons opened this issue Dec 26, 2022 · 9 comments · Fixed by #4215
Closed

Allow forcing uniqueness for any field in schema configuration #2712

grantfitzsimmons opened this issue Dec 26, 2022 · 9 comments · Fixed by #4215
Assignees
Labels
1 - Request A request made by a member of the community 2 - Database/Schema Issues that are related to the underlying database and schema 2 - Schema Config Issues that are related to the Schema Config tool
Milestone

Comments

@grantfitzsimmons
Copy link
Member

My main concern is that these 'numbers' will need to be unique across the collection without turning on auto-numbering most likely. So basically, they should behave like the main 'catalognumber' field. Is a uniqueness check something that can be turned on anywhere for a field?

Requested By: Corinna P at CSIRO

also requested by UMich, New Mexico, New Brunswick Museum, and many more. This is a common request. If an issue for this has already been created, please merge/close this one.

@grantfitzsimmons
Copy link
Member Author

grantfitzsimmons commented Feb 1, 2023

Requested By: Alexis Beck with NHM Geneva

@specifysoftware
Copy link

This issue has been mentioned on Specify Community Forum. There might be relevant details there:

https://discourse.specifysoftware.org/t/require-unique-value/303/11

@grantfitzsimmons grantfitzsimmons moved this to 📋 Backlog in Front-End Backlog Mar 9, 2023
@melton-jason
Copy link
Contributor

Here is a list of all uniqueness constraints at a database level
(From #2924 (comment))

TableName IndexName Unique Columns
accessionagent Role Role, AgentID, AccessionID
agentspecialty AgentID AgentID, OrderNumber
appraisal AppraisalNumber AppraisalNumber
author ReferenceWorkID ReferenceWorkID, AgentID
auth_group name name
auth_group_permissions auth_group_permissions_group_id_permission_id_0cd325b0_uniq group_id, permission_id
auth_permission auth_permission_content_type_id_codename_01ab375a_uniq content_type_id, codename
borrowagent Role Role, AgentID, BorrowID
collectingevent DisciplineID DisciplineID, UniqueIdentifier
collectionobject CollectionID CollectionID, UniqueIdentifier
collectionobject CollectionID_2 CollectionID, CatalogNumber
collector AgentID AgentID, CollectingEventID
deaccessionagent Role Role, AgentID, DeaccessionID
determinationcitation ReferenceWorkID ReferenceWorkID, DeterminationID
determiner AgentID AgentID, DeterminationID
disposalagent Role Role, AgentID, DisposalID
django_content_type django_content_type_app_label_model_76bd3d3b_uniq app_label, model
extractor AgentID AgentID, DNASequenceID
fundingagent AgentID AgentID, CollectingTripID
giftagent Role Role, GiftID, AgentID
groupperson OrderNumber OrderNumber, GroupID
loanagent Role Role, LoanID, AgentID
locality DisciplineID DisciplineID, UniqueIdentifier
localitycitation ReferenceWorkID ReferenceWorkID, LocalityID
pcrperson AgentID AgentID, DNASequenceID
preparation CollectionMemberID CollectionMemberID, BarCode
specifyuser Name Name

To maintain compatibility (both with 6 and with migrating from previous versions of 7), these will be 'read-only' uniqueness rules and will not be able to be modified or removed.

⚠️⚠️ Warnining ⚠️⚠️

It must be noted that any custom uniqueness rule will not be enforced in Specify 6.

@grantfitzsimmons
Copy link
Member Author

Geneva would like this as well!

@grantfitzsimmons grantfitzsimmons added 2 - Forms Issues that are related to the form system 2 - Database/Schema Issues that are related to the underlying database and schema and removed Unsorted labels Jul 2, 2023
@grantfitzsimmons
Copy link
Member Author

@melton-jason How far along is your work on this project? I remember you talking to me about this in March.

@grantfitzsimmons
Copy link
Member Author

This is the one and only requirement for CSIRO to migrate their collections this fall.

@realVinayak
Copy link
Contributor

Do they want a support for this on the backend? For example, should those constraints be considered for workbench too?

@melton-jason
Copy link
Contributor

Yes, the rules would be supported by the backend (and thus the API and Workbench) too.

@grantfitzsimmons grantfitzsimmons added 2 - Schema Config Issues that are related to the Schema Config tool and removed 2 - Forms Issues that are related to the form system labels Aug 14, 2023
@melton-jason melton-jason linked a pull request Nov 16, 2023 that will close this issue
@CarolineDenis CarolineDenis added this to the 7.9.3 milestone Dec 6, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Front-End Backlog Jan 16, 2024
@specifysoftware
Copy link

This issue has been mentioned on Specify Community Forum. There might be relevant details there:

https://discourse.specifysoftware.org/t/specify-7-9-3-release-announcement/1499/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Request A request made by a member of the community 2 - Database/Schema Issues that are related to the underlying database and schema 2 - Schema Config Issues that are related to the Schema Config tool
Projects
Status: Shipped
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants