1.0.2 • Published 8 years ago

sequelize-short v1.0.2

Weekly downloads
3
License
ISC
Repository
-
Last release
8 years ago

sequelize-short

some useful utilities for sequelize, such as simeple datatype.

Installation

  npm install sequelize-short

simpel Datatype

var sequelizex = require('sequelize-short');
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;
};
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago