Modified db for autoincrement, implemented sql entity update