fixing user, roles and permissions and using foreign keys