Check and Run entities are using their name as the primary key. Even though they have a manager id relationship it is not used as part of a composite key.
This was for sure by accident and not intentional...for postgres, at least, this doesn't seem to cause immediate issues but for mysql/maria if a user tries to run CM with multiple subreddits using the same run/check names in each subreddit config CM will encounter db insert errors due to non-unique primary keys.
Solution is to use composite key or random id primary key. In either solution we will need to manually update result entities to match new key or truncate result tables during migration.
Check and Run entities are using their
name
as the primary key. Even though they have a manager id relationship it is not used as part of a composite key.This was for sure by accident and not intentional...for postgres, at least, this doesn't seem to cause immediate issues but for mysql/maria if a user tries to run CM with multiple subreddits using the same run/check names in each subreddit config CM will encounter db insert errors due to non-unique primary keys.
Solution is to use composite key or random id primary key. In either solution we will need to manually update result entities to match new key or truncate result tables during migration.