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

basic-mapping.ejs 571 Bytes
var Project = sequelize.define('Project', {
  title: Sequelize.STRING,
  description: Sequelize.TEXT
})

var Task = sequelize.define('Task', {
  title: Sequelize.STRING,
  description: Sequelize.TEXT,
  deadline: Sequelize.DATE
})

// You can also set some options:
var Foo = sequelize.define('Foo', {
  // instantiating will automatically set the flag to true if not set
  flag: { dataType: Sequelize.BOOLEAN, allowNull: false, defaultValue: true},
  // setting no title will throw an error when trying to save
  title: { dataType: Sequelize.STRING, allowNull: false}
})