Add unique constraint to `software_licenses.name` column.

The following discussion from !19598 (merged) should be addressed:

  • @mbobin started a discussion: (+4 comments)

    safe_find_or_create_by! requires a unique index on name to work and it seems that we don't have it.

Additional information:

safe_find_or_create_by is used to create a new software license record using the name as the unique identifier for the record. However, the software_licenses.name column does not have a unique constraint.

  • Introduced in 68a087e7
  • Moved in ae997cdf

Implementation Plan

Backend - Done @xlgmokha

  • Check if we have any name collisions in any of our environments.
  • Check to see if it is safe to add a unique constraint to the software_licenses.name column without disruption.

Documentation - person

  • User Documentation (is this needed?)
Edited Nov 20, 2019 by mo khan
Assignee Loading
Time tracking Loading