balderdashy/waterline-sequel — pull request #16 by DavidEBest (2014-11-23 02:18:51+00:00)
Title: Making the schema matching for case insensitivity more flexible.

The checks for text/string fields were incomplete when building case insensitive queries. In a few spots the schema checks were checking for a type = 'text', but were not checking for the other equivalent (given a pg backend) permutations.

For example, given the following set of attributes, only the fourth would be treated in a case insensitive manner for an equality check. The others would be treated in a case sensitive manner.

```javascript
// 1
firstName: {
type: 'string',
required: true
},
// 2
lastName: 'string',
// 3
address: 'text',
// 4
address2: {
type: 'text',
required: true
}
```
I found this while working through some of the failing sails-postgres integration tests