[db] Fix broken join that makes nick values wrong

It was always selecting the first value, no matter what, because the
join was stupidly not making sure the IDs were the same.
Migration script now does nulls and channels correctly