Change owner field to an Integer
Replace login by user_id in "owner" relations between user and other entity.
Avoid sql key words (user, key, order).
Add cascade delete on all fk exept owner.