changed from sqlite to pg and mySQL