How to use the sequelize.INTEGER function in sequelize

To help you get started, we’ve selected a few sequelize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maoxiaoquan / kite / db / mysqldb / models_type / db_attention.js View on Github external
},
    uid: {
      // 用户ID
      type: Seq.INTEGER(10),
      comment: 'uid',
      field: 'uid'
    },
    associate_id: {
      // 关联的内容
      type: Seq.STRING(50),
      comment: '关联的内容',
      field: 'associate_id'
    },
    type: {
      // 类型
      type: Seq.INTEGER(6),
      comment: '类型',
      field: 'type'
    },
    is_associate: {
      // 是否like
      type: Seq.BOOLEAN,
      comment: '是否关联',
      field: 'is_associate'
    },
    ...time.create_date
  }
}
github maoxiaoquan / kite / db / mysqldb / models_type / db_user_authority.js View on Github external
},
    authority_parent_name: {
      // 父权限名字
      type: Seq.CHAR(100),
      comment: '父权限名字',
      field: 'authority_parent_name'
    },
    authority_url: {
      // 权限树的连接路径
      type: Seq.CHAR(100),
      comment: '权限树的连接路径',
      field: 'authority_url'
    },
    authority_sort: {
      // 权限树的排序
      type: Seq.INTEGER(20),
      comment: '权限树的排序',
      field: 'authority_sort'
    },
    authority_description: {
      // 权限描述
      type: Seq.STRING(100),
      comment: '权限描述',
      field: 'authority_description'
    },
    enable: {
      // 是否可以显示
      type: Seq.BOOLEAN,
      comment: '是否可以显示',
      field: 'enable'
    },
    ...time.create_date
github maoxiaoquan / kite / db / mysqldb / models_type / db_order.js View on Github external
field: 'product_id'
    },
    product_type: {
      type: Seq.BIGINT(20),
      comment: '产品类型',
      field: 'product_type'
    },
    status: {
      // 状态
      type: Seq.INTEGER(10),
      comment: '状态',
      field: 'status'
    },
    pay_type: {
      // 支付类型
      type: Seq.INTEGER(6),
      comment: '支付类型',
      field: 'pay_type'
    },
    amount: {
      type: Seq.DECIMAL(8, 2),
      comment: '金额',
      field: 'amount'
    },
    description: {
      // 描述
      type: Seq.TEXT,
      comment: '描述',
      field: 'description'
    },
    ...time.create_date
  }
github domfarolino / angular2-login-seed / models / user.js View on Github external
module.exports = function(sequelize, DataTypes) {
  var User = sequelize.define('User', {
    id:{
        type:          Sequelize.INTEGER(11),
        field:         'id',
        allowNull:     false,
        primaryKey:    true,
        autoIncrement: true
    },
    social_id:{
        type:      Sequelize.STRING(64),
        field:     'social_id',
        allowNull: true
    },
    name:{
        type:      Sequelize.STRING(64),
        field:     'name',
        allowNull: false
    },
    username:{
github ahnuchen / yizhaopinApp / lib / create_orm.js View on Github external
WorkExperience: {type: Sequelize.TEXT, allowNull: false},//工作经历JSONString[{company:"",position:"",joinTime:"",leaveTime:"",content:""},...]
    EducationExperience: {type: Sequelize.TEXT, allowNull: false},//教育经历:JSONString[{school:"",major:"",endTime:"",degree:""}]
    ExpectWork: {type: Sequelize.TEXT, allowNull: false},//期待工作JSONString:{name:"前端",type:"全职",city:"南京",salary:1,addtion:"补充说明(若有)"}
    ProjectExperience: {type: Sequelize.TEXT, allowNull: true}, //项目经验 JSONString {name:"商城",position:"",startTime:"",endTime:"",description:"",link:""}
    PersonalDescription: Sequelize.TEXT,//个人描述
    Delete: {type: Sequelize.INTEGER(1), allowNull: false, defaultValue: 1},//删除字段:{-1:删除,>=1未删除}
  });
  /**
   * 简历投递表
   */
  orm.JobApply = yizhaopin.define('jobApply', {
    ID: {type: Sequelize.INTEGER(10), primaryKey: true, allowNull: false, autoIncrement: true},
    Process: {type: Sequelize.INTEGER(1), allowNull: false, defaultValue: 0},//简历状态:{1:已投递,2:待沟通,3:面试,4:不合适}
    InterviewDate: Sequelize.DATE,//面试时间(简历面试之后一个月过期)
    InterviewPosition: Sequelize.STRING(200),//面试地点
    companyID:Sequelize.INTEGER(10),
    Delete: {type: Sequelize.INTEGER(1), allowNull: false, defaultValue: 1},//删除字段:{-1:删除,>=1未删除}
  });
  /**
   * 收藏表
   */
  orm.Favorite = yizhaopin.define('favorite', {
    ID: {type: Sequelize.INTEGER(10), primaryKey: true, allowNull: false, autoIncrement: true},
    JobID: Sequelize.INTEGER(10)
  });
  /**
   * 关联表
   */
  //用户<=>简历 一对一
  orm.User.hasOne(orm.Resume);
  orm.Resume.belongsTo(orm.User);
  //公司<=>职位 一对多
github midwayjs / sandbox / packages / sandbox-core / src / core / model / dw / sandboxGalaxySlsTraceNodes.ts View on Github external
allowNull: false,
    },
    spanName: {
      type: Sequelize.STRING(512),
      field: 'span_name',
    },
    spanTimestamp: {
      type: Sequelize.STRING(128),
      field: 'span_timestamp',
    },
    spanDuration: {
      type: Sequelize.INTEGER,
      field: 'span_duration',
    },
    spanError: {
      type: Sequelize.INTEGER({
        length: 4,
      }),
      allowNull: true,
      defaultValue: 0,
      field: 'span_error',
    },
    spanType: {
      type: Sequelize.INTEGER,
      field: 'span_type',
    },
    spanMethod: {
      type: Sequelize.STRING(128),
      field: 'span_method',
    },
    spanTarget: {
      type: Sequelize.TEXT,
github midwayjs / sandbox / packages / sandbox-core / src / core / model / core / sandboxApplications.ts View on Github external
field: 'alinode_token',
    },
    flag: {
      type: Sequelize.INTEGER.UNSIGNED,
      allowNull: true,
    },
    deleted: {
      type: Sequelize.INTEGER({
        length: 4,
        unsigned: true,
      }),
      allowNull: true,
      defaultValue: 0,
    },
    state: {
      type: Sequelize.INTEGER({
        length: 4,
        unsigned: true,
      }),
      allowNull: false,
    },
  }, {
    timestamps: true,
    createdAt: 'gmt_create',
    updatedAt: 'gmt_modified',
    freezeTableName: true,
    tableName: 'sandbox_applications',
  });

  return ApplicationModel;
}

sequelize

Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift and Snowflake’s Data Cloud. It features solid transaction support, relations, eager and lazy loading, read replication and more.

MIT
Latest version published 25 days ago

Package Health Score

95 / 100
Full package analysis