#19 Multiple CLA done entries
Closed: Fixed None Opened 16 years ago by mmcgrath.

Some users in the account system have multiple CLA done entries. Can we remove duplicate entries?


Short answer: Yes and I'll do that now.

Longer answer: There's an error in the db schema. It allows role_domain to be null. It also sets a unique constraint on (person_id, project_group_id, role_domain). Nulls in SQL have the strange property of matching nothing, including other nulls. So I could potentially enter (1,1, null) multiple times. We eventually need to move everyone who has null for role_domain to '' and change the role_domain column to not null.

Okay. All duplicates have been taken care of. Just in case I deleted someone's cla_done, there's a backup of the table saved as role20070706. We can delete this after a week or so if no one notices.

Nobody in the db currently has role_domain = ''. I didn't change the schema as I have a feeling that will break some of our apps. If we're feeling ambitious, after a few weeks we can take a look at what groups have a role_domain of null and try to track down places in the code where that's happening.

Login to comment on this ticket.

Metadata