I\'m using Sails 0.9.8 paired with MySQL and wanting to do something like this
localhost:1337/player/view/
instea
The marked answer is quiet old. As per the latest sails version (1.0.2 as of the date of writing this answer),
I used the columnType
attribute like this:
attributes: {
longDescription: {
type: 'string',
columnType: 'text'
}
}
You could work around this by defining custom validation rules via the types object. Specifically the given problem could be solved by defining a custom size
validator that always returns true.
// api/models/player.js
module.exports = {
types: {
size: function() {
return true;
}
},
attributes: {
username: {
type: 'string',
unique: true,
minLength: 4,
maxLength: 32,
size: 32,
required: true
}
}
}