How to use the ENUM function from sequelize

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

245
246
247
248
249
250
251
252
253
254
  allowNull: true,
  defaultValue: 0.00,
  field: 'TotalAmount'
},
status: {
  type: DataTypes.ENUM('PROCESSING','SHIPPED','UNKNOWN'),
  allowNull: false,
  defaultValue: "UNKNOWN",
  field: 'Status'
}
fork icon500
star icon0
watch icon59

+ 3 other calls in file

45
46
47
48
49
50
51
52
53
54
  type: Sequelize.INTEGER,
  defaultValue: 0
},

status: {
  type: Sequelize.ENUM(
    'master',
    'sent',
    'merge',
    'disputed',
fork icon16
star icon80
watch icon23

58
59
60
61
62
63
64
exports._RANGE     = Sequelize.RANGE;
exports._GEOMETRY  = Sequelize.GEOMETRY;
exports._GEOGRAPHY = Sequelize.GEOGRAPHY;
exports._VIRTUAL   = Sequelize.VIRTUAL;
exports._ENUM      = function (arr) {
  return Sequelize.ENUM.apply(this, arr);
};
fork icon10
star icon15
watch icon25

+ 9 other calls in file

155
156
157
158
159
160
161
162
163
164
timestamp: {
	type: Sequelize.BIGINT,
	allowNull: false
},
type: {
	type: Sequelize.ENUM('OPEN', 'CLOSE', 'DESCRIPTION'),
	allowNull: false
},
data: Sequelize.TEXT,
queue_id: {
fork icon1
star icon3
watch icon2

+ 7 other calls in file

1
2
3
4
5
6
7
8
9
10
const db = require('../db')
const uuidv1 = require('uuid/v1')

const Guest = db.define('guest', {
  status: {
    type: Sequelize.ENUM('attending', 'invited', 'declined'),
    defaultValue: 'invited'
  },
  firstName: Sequelize.STRING,
  email: {
fork icon1
star icon3
watch icon1

14
15
16
17
18
19
20
21
22
23
password: {
  type: Sequelize.STRING(100),
  allowNull: true,
},
provider: {
  type: Sequelize.ENUM('local', 'kakao'),
  allowNull: false,
  defaultValue: 'local',
},
snsId: {
fork icon0
star icon0
watch icon0

2
3
4
5
6
7
8
9
10
11
12
const { models } = require("../db")
const {createMatrix, fillInBlanks } = require("../../algorithm")


const Preference = db.define("preference", {
  preference: {
    type: Sequelize.ENUM('like', 'dislike'),
    allowNull: false,
    validate: {
      notEmpty: true
    }
fork icon0
star icon0
watch icon0

158
159
160
161
162
163
164
165
166
167
168


const User = sequelize.define(
  "User",
  {
    role: {
      type: Sequelize.ENUM("SUPERADMIN", "RESELLER", "HOTEL", "USER"),
      allowNull: false,
    },
    password: {
      type: Sequelize.STRING,
fork icon0
star icon0
watch icon0

5
6
7
8
9
10
11
12
13
14
host: {
  type: Sequelize.STRING(80),
  allowNull: false,
},
type: {
  type: Sequelize.ENUM('free', 'premium'),
  allowNull: false,
},
clientSecret: {
  type: Sequelize.UUID,
fork icon0
star icon0
watch icon0

17
18
19
20
21
22
23
24
25
26
emergency: {
  type: BOOLEAN,
  defaultValue: false
},
rescued: {
  type: ENUM('yes', 'no', 'in progress'),
  defaultValue: 'no'
},
latitude: {
  type: DOUBLE,
fork icon0
star icon0
watch icon2

+ 3 other calls in file