How to use the TEXT function from sequelize

Find comprehensive JavaScript sequelize.TEXT code examples handpicked from public code repositorys.

32
33
34
35
36
37
38
39
40
41
  comment: '描述',
  field: 'description'
},
content: {
  // 内容
  type: Seq.TEXT('long'),
  comment: '内容',
  field: 'content'
},
origin_content: {
fork icon115
star icon516
watch icon11

+ 3 other calls in file

24
25
26
27
28
29
30
31
32
33

var Sequelize = require('sequelize');

exports._STRING    = Sequelize.STRING;
exports._CHAR      = Sequelize.CHAR;
exports._TEXT      = Sequelize.TEXT;
exports._INTEGER   = Sequelize.INTEGER;
exports._BIGINT    = Sequelize.BIGINT;
exports._BIGINT0   = Sequelize.BIGINT;
exports._FLOAT     = Sequelize.FLOAT;
fork icon10
star icon15
watch icon25

+ 9 other calls in file

27
28
29
30
31
32
33
34
35
    type: Sequelize.CHAR(20).BINARY,
    primaryKey: true
  },
  code: Sequelize.BLOB,
  source: {
    type: Sequelize.TEXT('long'),
    allowNull: true
  }
}, {freezeTableName: true, underscored: true, timestamps: false})
fork icon31
star icon13
watch icon5

36
37
38
39
40
41
42
43
44
45
  return { type: addNull ? ['string', 'null'] : 'string', format: 'uuid' };
}

if (type instanceof Sequelize.CHAR
  || type instanceof Sequelize.STRING
  || type instanceof Sequelize.TEXT
  || type instanceof Sequelize.UUID
  || type instanceof Sequelize.DATE
  || type instanceof Sequelize.DATEONLY
  || type instanceof Sequelize.TIME) {
fork icon22
star icon0
watch icon15

+ 2 other calls in file

39
40
41
42
43
44
45
46
47

```js

class Foo extends Model {}
Foo.init({
  example: Sequelize.TEXT
}, { sequelize, modelName: 'foo' })

```
fork icon2
star icon2
watch icon1

+ 3 other calls in file

102
103
104
105
106
107
108
109
110
111
case 'string':
    if (length) {
        return Sequelize.STRING(length);
    }

    return Sequelize.TEXT;
case 'array':
    return Sequelize.TEXT;
case 'object':
    return Sequelize.TEXT('medium');
fork icon6
star icon0
watch icon6

+ 5 other calls in file