We currently return the empty set whenever we encounter an SQLException related to the schema_migrations table. This appears to be primarily to handle the case of PostgreSQL's error state of 42P01, undefined_table. In this case the PuppetDB needs to be created. In all other cases, there doesn't seem to be a benefit to catching the error and attempting to continue because the database already exists, attempting to re-apply migrations, which I believe will happen, could break the database state. We should instead let this error percolate up. We also specifically squash the error stay 42501 (labelled as for hsqldb). Since we no longer support that database, but it is also PostgreSQL's error state for insufficient_privilege, I'd recommend we either print a nicer error message if its likely that people will be using the wrong database user. If it's unlikely that they use the wrong database user, we can just let it percolate up as the rest do. |