Sequelize.DATE// DATETIME for mysql / sqlite, TIMESTAMP WITH TIME ZONE for postgres
Sequelize.DATE// DATETIME for mysql / sqlite, TIMESTAMP WITH TIME ZONE for postgres
Sequelize.BOOLEAN// TINYINT(1)
Sequelize.BOOLEAN// TINYINT(1)
Sequelize.ENUM('value 1','value 2')// An ENUM with allowed values 'value 1' and 'value 2'
Sequelize.ENUM('value 1','value 2')// An ENUM with allowed values 'value 1' and 'value 2'
Sequelize.ARRAY(Sequelize.TEXT)// Defines an array. PostgreSQL only.
Sequelize.ARRAY(Sequelize.TEXT)// Defines an array. PostgreSQL only.
Sequelize.BLOB// BLOB (bytea for PostgreSQL)
Sequelize.BLOB// BLOB (bytea for PostgreSQL)
Sequelize.BLOB('tiny')// TINYBLOB (bytea for PostgreSQL. Other options are medium and long)
Sequelize.BLOB('tiny')// TINYBLOB (bytea for PostgreSQL. Other options are medium and long)
Sequelize.UUID// UUID datatype for PostgreSQL and SQLite, CHAR(36) BINARY for MySQL (use defaultValue: Sequelize.UUIDV1 or Sequelize.UUIDV4 to make sequelize generate the ids automatically)
Sequelize.UUID// UUID datatype for PostgreSQL and SQLite, CHAR(36) BINARY for MySQL (use defaultValue: Sequelize.UUIDV1 or Sequelize.UUIDV4 to make sequelize generate the ids automatically)
...
@@ -143,7 +143,7 @@ var Foo = sequelize.define('Foo', {
...
@@ -143,7 +143,7 @@ var Foo = sequelize.define('Foo', {
/*
/*
do your magic here and return something!
do your magic here and return something!
'this' allows you to access attributes of the model.
'this' allows you to access attributes of the model.
example: this.getDataValue('name') works
example: this.getDataValue('name') works
*/
*/
},
},
...
@@ -165,33 +165,33 @@ var defaultToWhiteSpace = function(characters) {
...
@@ -165,33 +165,33 @@ var defaultToWhiteSpace = function(characters) {