How to use the INTEGER function from sequelize

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

83
84
85
86
87
88
89
90
91
92
  field: 'rss_count',
  defaultValue: 0
},
sort: {
  // 排序
  type: Seq.INTEGER(10),
  comment: '排序',
  field: 'sort'
},
is_show: {
fork icon115
star icon517
watch icon11

101
102
103
104
105
106
107
108
109
110
  defaultValue: Seq.NOW /* 时间 */
},
// 2019.11.6 11:55新增
is_free: {
  // 是否免费
  type: Seq.INTEGER(6),
  comment: '是否免费',
  field: 'is_free'
},
pay_type: {
fork icon115
star icon516
watch icon11

+ 7 other calls in file

201
202
203
204
205
206
207
208
209
210
 */
var BlockBatch = sequelize.define('BlockBatch', {
  source_uid: Sequelize.BIGINT.UNSIGNED,
  currentCursor: Sequelize.STRING,
  complete: Sequelize.BOOLEAN,
  size: Sequelize.INTEGER
});
BlockBatch.hasMany(Block, {onDelete: 'cascade'});
Block.belongsTo(TwitterUser, {foreignKey: 'sink_uid'});
BtUser.hasMany(BlockBatch, {foreignKey: 'source_uid', onDelete: 'cascade'});
fork icon74
star icon332
watch icon25

63
64
65
66
67
68
69
70
71
72
                }
        },
        
        MobProtoId: Seq.INTEGER,
        
        ItemProtoId: Seq.INTEGER
        
};

var char_quest_struct = {
fork icon17
star icon93
watch icon15

222
223
224
225
226
227
228
229
230
231

  // who caused us to make this payment (if we're bank)?
  inward_pubkey: Sequelize.BLOB,

  // resulting balance
  resulting_balance: Sequelize.INTEGER

},
{
  indexes: [
fork icon16
star icon80
watch icon23

95
96
97
98
99
100
101
102
103
104
})

const Debt = sequelize.define('debt', {
  asset: Sequelize.INTEGER,
  amount_left: Sequelize.INTEGER,
  oweTo: Sequelize.INTEGER
})

// onchain balances (w/o bank)
const Balance = sequelize.define('balance', {
fork icon16
star icon80
watch icon23

+ 11 other calls in file

22
23
24
25
26
27
28
29
30
31
      msg: '优先级最大值为5',
    },
  }
},
status: {
  type: Sequelize.INTEGER
},
create_time: {
  type: Sequelize.INTEGER,
  allowNull: false,
fork icon35
star icon61
watch icon22

25
26
27
28
29
30
31
32
33
34
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;
exports._FLOAT0    = Sequelize.FLOAT;
fork icon10
star icon15
watch icon25

+ 9 other calls in file

10
11
12
13
14
15
16
17
18
19
    console.log(arg1)
    console.log(arg2)
};

schema.Types = {};
schema.Types.ObjectId = Sequelize.INTEGER;

schema.prototype.add = function (args , parentKey) {
    console.log('dbObj::Schema::add')
    console.log(args)
fork icon0
star icon9
watch icon2

18
19
20
21
22
23
24
25
26
27
  heading: Sequelize.INTEGER,
  location: Sequelize.GEOGRAPHY,
  power: Sequelize.INTEGER,
  shift_state: Sequelize.CHAR,
  range: Sequelize.INTEGER,
  est_range: Sequelize.INTEGER
}, {
  timestamps: true,
  underscored: true
});
fork icon0
star icon3
watch icon2

197
198
199
200
201
202
203
204
205
206
};

if (fieldName === 'id') {
    output.primaryKey = true;
    output.autoIncrement = true;
    output.type = Sequelize.INTEGER.UNSIGNED;
}

if (schema.keys.indexOf(fieldName) !== -1) {
    output.unique = 'uniquerow';
fork icon6
star icon0
watch icon6

0
1
2
3
4
5
6
7
8
9
const DataTypes = require('sequelize');
const mysql = require('../database');

module.exports = mysql.define('products', {
  'id': {
    type: DataTypes.INTEGER(11),
    allowNull: false,
    primaryKey: true,
    comment: "null",
    autoIncrement: true
fork icon1
star icon2
watch icon2

+ 7 other calls in file

8
9
10
11
12
13
14
15
16
17
  type: Sequelize.STRING(150),
  field: 'name',
  allowNull: false
},
ownerId: {
  type: Sequelize.INTEGER(),
  field: 'owner_id',
  allowNull: false
},
slug: {
fork icon0
star icon2
watch icon3

0
1
2
3
4
5
6
7
8
9
10
const Sequelize = require("sequelize");
const sequelize = require("./connectToDB");


const Expense = sequelize.define("expenses", {
    id: {
        type: Sequelize.INTEGER.UNSIGNED,
        autoIncrement: true,
        primaryKey: true,
        timestamps: true,
    },
fork icon0
star icon0
watch icon0