Make upgrade script safer by putting the drop table statement inside a function with the insert statement, so if the insert fails, the drop table won't get executed.
Do not error out completely when queries cannot be loaded, but do log an error log message. The old 'error' call could prevent the server from starting at all if you e.g. deleted a package from the file system without deleting it from the APM first.