You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

sequelize-date-no-tz-postgres

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sequelize-date-no-tz-postgres

Add support for DATE-NO-TZ data-type for PostgreSQL in Sequelize

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
2.6K
11.13%
Maintainers
1
Weekly downloads
 
Created
Source

sequelize-date-no-tz-postgres

NPM version

Add support for DATE (timestamp without time zone) data-type for PostgreSQL in Sequelize.

Motivation

Read:

Install

npm install --save sequelize-date-no-tz-postgres

Use to define models

models/my_model.js

const withDateNoTz = require('sequelize-date-no-tz-postgres');

module.exports = function (sequelize, SequelizeDataTypes) {
  const DataTypes = withDateNoTz(SequelizeDataTypes);

  const MyModel = sequelize.define('myModel', {
    someDateWithoutTzField: {
      type: DataTypes.DATE_NO_TZ
    },

    // ...
  });

  // ...

  return MyModel;
};

Use in migrations

migrations/<timestamp>-add-some-date-field-to-my-model.js

const withDateNoTz = require('sequelize-date-no-tz-postgres');

module.exports = {
  up: function (queryInterface, SequelizeBase) {
    const Sequelize = withDateNoTz(SequelizeBase);

    return queryInterface.addColumn('myModel', 'someDateWithoutTzField', {
      type: Sequelize.DATE_NO_TZ
    });
  },

  // ...
};

Keywords

PostgreSQL

FAQs

Package last updated on 16 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts