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

New Django Command: Create COT defaults for all collections #6298

Open
grantfitzsimmons opened this issue Mar 5, 2025 · 0 comments · May be fixed by #6308
Open

New Django Command: Create COT defaults for all collections #6298

grantfitzsimmons opened this issue Mar 5, 2025 · 0 comments · May be fixed by #6308
Labels
Migration Prs that contain migration

Comments

@grantfitzsimmons
Copy link
Member

Summary

We need a Django command to generate default collectionobjecttype (COT) records for all collections that currently are missing them, and assign the default COT to all collectionobject (CO) records that do not currently have this set.

This is caused primarily by collections created in Specify 6 after the initial uniqueness rule migrations have been run, but can also be made worse by new CO records being entered in Specify 6 which will not have a COT set and not obey the default COT for the collection.

The command should intelligently skip records that already have COTs in place and not recreate or reassign any COTs that have been configured by the user.

Acceptance Criteria

  • The command should find all collections and identify those without a default COT assigned.
    • A default COT should be created and assigned for the collection.
  • The command should find all collection objects and identify those without a COT assigned.
    • The default COT for the collection should be assigned to all COs.
  • The command should find all collections and identify those without a default COT set.
  • The command should not affect any user-assigned COTs for existing COs.

Implementation Details

  • Suggested command name: create_cots
  • Implement checks to determine if COTs exist before creating new ones.
@grantfitzsimmons grantfitzsimmons added the Migration Prs that contain migration label Mar 5, 2025
@acwhite211 acwhite211 linked a pull request Mar 7, 2025 that will close this issue
68 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Migration Prs that contain migration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant