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

Commit b19db76e by Mike DeLucco

Update models.md

1 parent 6401eba4
Showing with 4 additions and 4 deletions
...@@ -84,9 +84,9 @@ Sequelize.BLOB('tiny') // TINYBLOB (bytea for PostgreSQL. Other o ...@@ -84,9 +84,9 @@ Sequelize.BLOB('tiny') // TINYBLOB (bytea for PostgreSQL. Other o
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)
``` ```
The BLOB data type allows you to insert data both as strings and as buffers. When you do a find or findAll on a model which has a BLOB column, that data will always be returned as a buffer. The BLOB data type allows you to insert data both as strings and as buffers. When you do a find or findAll on a model which has a BLOB column. that data will always be returned as a buffer.
If you are working with the PostgreSQL TIMESTAMP WITHOUT TIME ZONE and you need to parse it to a different timezone, please use the pg library's own parser: If you are working with the PostgreSQL TIMESTAMP WITHOUT TIME ZONE and you need to parse it to a different timezone, please use the pg library's own parser:
```js ```js
require('pg').types.setTypeParser(1114, function(stringValue) { require('pg').types.setTypeParser(1114, function(stringValue) {
...@@ -95,7 +95,7 @@ require('pg').types.setTypeParser(1114, function(stringValue) { ...@@ -95,7 +95,7 @@ require('pg').types.setTypeParser(1114, function(stringValue) {
}); });
``` ```
In addition to the type mentioned above, integer, bigint and float also support unsigned and zerofill properties, which can be combined in any order: In addition to the type mentioned above, integer, bigint and float also support unsigned and zerofill properties, which can be combined in any order,
```js ```js
Sequelize.INTEGER.UNSIGNED // INTEGER UNSIGNED Sequelize.INTEGER.UNSIGNED // INTEGER UNSIGNED
...@@ -107,7 +107,7 @@ Sequelize.INTEGER(11).UNSIGNED.ZEROFILL // INTEGER(11) UNSIGNED ZEROFILL ...@@ -107,7 +107,7 @@ Sequelize.INTEGER(11).UNSIGNED.ZEROFILL // INTEGER(11) UNSIGNED ZEROFILL
_The examples above only show integer, but the same can be done with bigint and float_ _The examples above only show integer, but the same can be done with bigint and float_
Usage in object notation: Usage in object notation:
```js ```js
// for enums: // for enums:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!