不要怂,就是干,撸起袖子干!

Commit f535c634 by Mick Hansen

implement review changes

1 parent 07a559c7
...@@ -116,13 +116,7 @@ SqlString.arrayToList = function(array, timeZone, dialect, field) { ...@@ -116,13 +116,7 @@ SqlString.arrayToList = function(array, timeZone, dialect, field) {
} }
var ret = 'ARRAY[' + valstr + ']'; var ret = 'ARRAY[' + valstr + ']';
if (!!field && !!field.type) { if (!!field && !!field.type) {
// Need to translate DATETIME to TIMESTAMP WITH TIME ZONE for Postgres here ret += '::' + field.type.toSql().replace(/\(\d+\)/g, '');
// There has to be a better solution than this
if (dialect === "postgres") {
ret += '::' + field.type.toSql().replace(/\(\d+\)/g, '').replace(/DATETIME/, 'TIMESTAMP WITH TIME ZONE');
} else {
ret += '::' + field.type.toSql().replace(/\(\d+\)/g, '');
}
} }
return ret; return ret;
} else { } else {
......
...@@ -2607,7 +2607,7 @@ describe(Support.getTestDialectTeaser('HasMany'), function() { ...@@ -2607,7 +2607,7 @@ describe(Support.getTestDialectTeaser('HasMany'), function() {
User.hasMany(Tasks[dataType], { foreignKey: 'userId', keyType: dataType, constraints: false }); User.hasMany(Tasks[dataType], { foreignKey: 'userId', keyType: dataType, constraints: false });
return Tasks[dataType].sync({ force: true }).then(function() { return Tasks[dataType].sync({ force: true }).then(function() {
expect(Tasks[dataType].rawAttributes.userId.type instanceof dataType).to.be.ok; expect(Tasks[dataType].rawAttributes.userId.type).to.be.an.instanceof(dataType);
}); });
}); });
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!