Skip to content

some useful utilities for sequelize, such as simeple datatype

Notifications You must be signed in to change notification settings

lext-7/sequelizex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sequelizex

some useful utilities for sequelize, such as simeple datatype.

Installation

  npm install sequelize-x

simpel Datatype

var sequelizex = require('sequelize-x');
var shortDataTypes = sequelizex.DataTypes;

module.exports = function (sequelize, DataTypes) {

  var Model = sequelize.define('Model', {

    string: shortDataTypes.String(),
    stringWithMaxlength: shortDataTypes.String(256),
    stringAllowNull: shortDataTypes.String(null, true),

    double: shortDataTypes.Double(),
    doubleWithCustomDefaultValue: shortDataTypes.Double(10),

    int: shortDataTypes.Int(),
    intWithCustomDefaultValue: shortDataTypes.Int(10),

    phone: shortDataTypes.Phone(true),
    phoneAllowNull: shortDataTypes.Phone(true),

    text: shortDataTypes.Text(),

    time: shortDataTypes.Date(),
  });

  return Model;
};

About

some useful utilities for sequelize, such as simeple datatype

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published