Course Materials: Term name uniqueness too strict

Bug #1942645 reported by Michele Morgan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.7
Fix Released
Medium
Unassigned

Bug Description

Different libraries in a consortium may need course terms with different starting and ending dates, and may choose to use the same name for their course term as another library.

There is a uniqueness constraint on asset.course_module_term on 'name' which prohibits this. It would make more sense in a consortium for the uniqueness constraint to be on 'owning_lib' as well as 'name'.

Revision history for this message
MaryAnn Alexander (maryann-alexander) wrote :

A patch is available at the tip of

working/user/malexander/lp1942645-term-name-uniqueness / https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/malexander/lp1942645-term-name-uniqueness

tags: added: pullrequest
Revision history for this message
Martha Driscoll (mjdriscoll) wrote :

The syntax of the database upgrade script is not quite right. The DROP and ADD need to be part of the ALTER TABLE statement. I modified the script to this:

ALTER TABLE asset.course_module_term
        DROP CONSTRAINT course_module_term_name_key;

ALTER TABLE asset.course_module_term
        ADD CONSTRAINT cmt_once_per_owning_lib UNIQUE (owning_lib, name);

The script ran and successfully dropped the constraint and added the new one. We will now test the functionality of the new constraint.

Revision history for this message
Beth Willis (willis-a) wrote :

I have tested this code and it works as expected. I consent to signing off on it with my name,
Beth Willis and my email address, <email address hidden>

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Beth. To be clear, are you signing off on the code as modified by Martha?

Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbej)
Revision history for this message
Beth Willis (willis-a) wrote :

Jane, yes! Sorry, I should have been more explicit. I am signing off on the code with the modifications provided by Martha Driscoll.

tags: added: signedoff
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks so much, MaryAnn, Martha, and Beth. With Martha's corrections, it works well for me; I am now able to create terms at different libraries that have the same name. I've pushed that version to master, rel_3_8, and rel_3_7.

Changed in evergreen:
milestone: none → 3.8.1
importance: Undecided → Medium
assignee: Jane Sandberg (sandbej) → nobody
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.