refactor sql setting at defaults.rb