-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add steps for running uniqueness rules
- Loading branch information
1 parent
f81b9f1
commit 0eee780
Showing
3 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,56 @@ | ||
# Steps After Adding a New Institutional Scoping Level in Specify 7 | ||
|
||
_Last updated 2024-12-09_ | ||
|
||
After adding a new [institutional scoping level](https://discourse.specifysoftware.org/t/specify-institutional-scopings/1046) (collection, discipline, division) to a Specify 7 database, follow these steps: | ||
|
||
![Example hierarchy](https://global.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/d/d48c17f6c1a95289032a45963388ee499f20f889.jpeg) | ||
|
||
![Scoping hierarchy](scopinghierarchy.png) | ||
|
||
> **WARNING:** Before following any of these steps, make sure to take a complete backup of any production database. | ||
## Collection | ||
|
||
_WIP_ | ||
|
||
## Discipline | ||
|
||
### Uniqueness Rules | ||
|
||
**Problem:** When a new discipline is added, the uniqueness rules are not automatically applied. This occurs because the migration process that creates the uniqueness rules is not already complete and does not run again. | ||
|
||
> ⚠️ **Warning:** Make sure to note any custom uniqueness rules. If any do not match the system's defaults, carefully back them up and re-add them once these steps are complete. | ||
|
||
**Solution:** | ||
|
||
1. Drop the `uniquenessrule_fields` table. | ||
2. Drop the `uniquenessrule` table. | ||
3. Remove the Django migration records associated with these migrations: | ||
|
||
```sql | ||
delete from django_migrations where name IN ('0001_initial','0002_default_unique_rules'); | ||
``` | ||
|
||
4. Enter the container directly via command line: | ||
|
||
```bash | ||
docker exec -it specifycloud-example-1 /bin/bash | ||
``` | ||
|
||
Inside the Docker `specify7` container, re-run the migrations: | ||
```bash | ||
ve/bin/python manage.py migrate businessrules 0002_default_unique_rules | ||
``` | ||
|
||
5. Verify that the `uniquenessrule_fields` and `uniquenessrule` tables are present. Go to the Schema Config in each discipline and verify that 'Collection Object' has a uniqueness rule for catalog number. | ||
|
||
|
||
## Division | ||
|
||
_WIP_ | ||
|
||
## Institution | ||
|
||
You may only have one institution per Specify database at this time. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.