Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recover from four kinds of init error
- ActiveRecord::SchemaMigrations and internal_metadata tables are being considered for dfe-analytics (ignore them) - discovering migrations pending on dfe-analytics init no longer bails pre-emptively - discovering missing database connection when database not present, also on init, also no longer bails pre-emptively - don't eager load unless we've got a database connection The final example is important because some contexts which lack db connections (eg asset precompilation) also don't provide all necessary eg ENV vars which would be required were we loading the whole app (which this init process does). So discover early if we have no database (call ActiveRecord::Base.connection). & if anything happens during Fields.check! catch that too. Log lines will tell us if we're bailing for want of a DB or for want of a migration. (There's no point in running check! if migration yet to run).
- Loading branch information