Upgraded database from sqlite to postgresql