fix updateDatabase script, add getDatabaseVersion and updateDatabaseVersion methods, make PDO throw exception