some database changes and orm changes