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

Commit bda00ef6 by Chia-liang Kao

DataTypes.ARRAY helper

1 parent d7bca298
Showing with 3 additions and 2 deletions
...@@ -7,5 +7,6 @@ module.exports = { ...@@ -7,5 +7,6 @@ module.exports = {
BOOLEAN: 'TINYINT(1)', BOOLEAN: 'TINYINT(1)',
FLOAT: 'FLOAT', FLOAT: 'FLOAT',
NOW: 'NOW', NOW: 'NOW',
ENUM: 'ENUM' ENUM: 'ENUM',
ARRAY: function(type) { return type + '[]' }
} }
...@@ -18,7 +18,7 @@ if (dialect.match(/^postgres/)) { ...@@ -18,7 +18,7 @@ if (dialect.match(/^postgres/)) {
self.User = sequelize.define('User', { self.User = sequelize.define('User', {
username: DataTypes.STRING, username: DataTypes.STRING,
email: {type: 'text[]'} email: {type: DataTypes.ARRAY(DataTypes.TEXT)}
}) })
}, },
onComplete: function() { onComplete: function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!