Skip to content

Change commit_id type on commit_user_mentions table

What does this MR do?

When creating DB tables for user mentions commit_user_mentions table was created with commit_id column as binary. Although we can store commit_id within this type we would need to explicitly cast from binary to string or string to binary for joining it with notes in determining which note contains which mentions.

SELECT count(*) FROM notes 
INNER JOIN commit_user_mentions 
ON notes.commit_id = commit_user_mentions.commit_id

ERROR:  operator does not exist: character varying = bytea
LINE 1: ...nner join commit_user_mentions on notes.commit_id = commit_u...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.

Reference MR: !19009 (diffs)

Fix:

Given there is no data yet in commit_user_mentions table or perhaps at the time of deploying this very little data we can fairly easily change the column type to varchar.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #42738 (closed)

Edited by Mayra Cabrera

Merge request reports