Ref. https://www.programmersought.com/article/66521561222/
See more detailsSequelize Chinese API documentation
The data type of Model in Sequelize corresponds to the data type in MySQL
Sequelize.STRING // VARCHAR(255) Type: String Maximum: 65535 characters
Sequelize.STRING(1234) // VARCHAR(1234) Type: variable length Maximum: 65535 characters
Sequelize.TEXT // TEXT Type: String Maximum: 65535 characters
Sequelize.TEXT('tiny') // TINYTEXT Type: String Maximum: 255 characters
Sequelize.INTEGER // INTEGER Type: Integer Maximum: Range (-2147483648~2147483647)
Sequelize.BIGINT // BIGINT Type: Integer Maximum: Range (+-9.22*10 to the 18th power)
Sequelize.BIGINT(11) // BIGINT(11) Type: Integer Maximum: Range (+-9.22*10 to the 18th power)
Sequelize.FLOAT // FLOAT Type: Single precision floating point type 8-bit precision (4 bytes)
Sequelize.FLOAT(11) // FLOAT(11) Type: Single precision floating point type 8-bit precision (4 bytes)
Sequelize.FLOAT(11, 12) // FLOAT(11,12) Type: Precision Floating Point 8-bit precision (4 bytes) m total number, d decimal places
Sequelize.DOUBLE // DOUBLE Type: Double-precision floating-point 16-bit precision (8 bytes)
Sequelize.DOUBLE(11) // DOUBLE(11) Type: Double-precision floating-point 16-bit precision (8 bytes)
Sequelize.DOUBLE(11, 12) // DOUBLE(11,12) Type: Double-precision floating-point 16-bit precision (8 bytes) m total number, d decimal places
Sequelize.DECIMAL // DECIMAL Type: Fixed point type
Sequelize.DECIMAL(10, 2) // DECIMAL(10,2) Type: Fixed point type Parameter m<65 is the total number, d<30 and d<m is the decimal place
Sequelize.DATE // DATETIME Type: Datetime Type Example: '2009-05-12 02:31:44'
Sequelize.DATE(6) // DATETIME(6)
Sequelize.DATEONLY // DATE without time.
Sequelize.BOOLEAN // TINYINT(1) Type: Integer Range (-128~127)
Sequelize.ENUM('value 1', 'value 2') // ENUM type: enumeration
Sequelize.BLOB // BLOB type: binary data
Sequelize.BLOB('tiny') // TINYBLOB type: binary data
'Programming > JavaScript, Node.js' 카테고리의 다른 글
리덕스(Redux)를 왜 사용하는가? (0) | 2021.07.12 |
---|---|
[sequelize] 컬럼 정의 (0) | 2021.07.06 |
[sequelize] DATETIME to TIMESTAMP (1) | 2021.07.06 |
serverless-dotenv-plugin (0) | 2021.06.30 |
Mac 에서 Homebrew 를 통해 node, npm, yarn 설치하기 (0) | 2021.06.22 |
댓글