var SquareProject = sequelize.define('SquareProject', {
name: {
type: DataTypes.STRING,
- unique: true,
+ unique: 'name',
allowNull: false,
validate: {
notEmpty: true
type: DataTypes.BLOB('long'),
get: function() {
if (this.getDataValue('preproduction')) {
- return _.toString(this.getDataValue('preproduction'));
- }
+ return _.toString(this.getDataValue('preproduction'));
+ }
}
},
production: {
type: DataTypes.BLOB('long'),
get: function() {
if (this.getDataValue('production')) {
- return _.toString(this.getDataValue('production'));
- }
+ return _.toString(this.getDataValue('production'));
+ }
}
}
}, {