Skip to content

A platform for community discussion. Free, open, simple.

FIX: db:create was failing due to site settings

Sam54c0aa788cc3
diff --git a/lib/site_settings/db_provider.rb b/lib/site_settings/db_provider.rb
index 3ad32164e98..0887e0edc4d 100644
--- a/lib/site_settings/db_provider.rb
+++ b/lib/site_settings/db_provider.rb
@@ -57,12 +57,12 @@ class SiteSettings::DbProvider
# table is not in the db yet, initial migration, etc
def table_exists?
@table_exists ||= {}
-
- unless @table_exists[current_site]
- @table_exists[current_site] = ActiveRecord::Base.connection.table_exists?(@model.table_name)
+ begin
+ @table_exists[current_site] ||= ActiveRecord::Base.connection.table_exists?(@model.table_name)
+ rescue
+ STDERR.puts "No connection to db, unable to retrieve site settings! (normal when running db:create)"
+ @table_exists[current_site] = false
end
-
- @table_exists[current_site]
end
end