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

Commit 8e9eaf36 by Jochem Maas

allow for MySQL COMMENT field-attribute in Model attribute definition

1 parent f54644e6
......@@ -6,10 +6,10 @@ module.exports = {
//make maxIdleTime small so that tests exit promptly
mysql: {
username: "root",
password: null,
password: "newdawn",
database: 'sequelize_test',
host: '127.0.0.1',
port: 3306,
host: 'localhost',
port: '/tmp/mysql.sock',
pool: { maxConnections: 5, maxIdleTime: 30}
},
......
......@@ -31,6 +31,13 @@ describe('DAOFactory', function() {
expect(User.attributes).toEqual({username:"VARCHAR(255) NOT NULL",id:"INTEGER NOT NULL auto_increment PRIMARY KEY"})
})
it("handles extended attributes (comment)", function() {
var User = sequelize.define('User' + config.rand(), {
username: {type: Sequelize.STRING, comment: 'This be\'s a comment'}
}, { timestamps: false })
expect(User.attributes).toEqual({username:"VARCHAR(255) COMMENT 'This be\\'s a comment'",id:"INTEGER NOT NULL auto_increment PRIMARY KEY"})
})
it("handles extended attributes (primaryKey)", function() {
var User = sequelize.define('User' + config.rand(), {
username: {type: Sequelize.STRING, primaryKey: true}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!