Refactor #10116 Add primary key to tables
http://tracker.modx.com/issues/10116