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.
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 module_ term_name_ key;
DROP CONSTRAINT course_
ALTER TABLE asset.course_ module_ term per_owning_ lib UNIQUE (owning_lib, name);
ADD CONSTRAINT cmt_once_
The script ran and successfully dropped the constraint and added the new one. We will now test the functionality of the new constraint.