• Patrick Bajao's avatar
    Handle race condition when creating an MR approval · 4152e1dd
    Patrick Bajao authored
    Add two migrations for deleting duplicates and adding a
    unique index for user_id and merge_request_id on approvals
    table.
    
    Since this migration will run on MySQL too, a separate
    query needs to be implemented for it as the one for PostgreSQL
    doesn't work on MySQL.
    
    This will prevent creation of duplicate records in case
    concurrent requests try to do the same thing.
    4152e1dd
remove_duplicates_from_approvals_spec.rb 1.44 KB