flexxnn / sequelize-auto-migrations

Migration generator && runner for sequelize
MIT License
258 stars 166 forks source link

Adding support postgresql ARRAY support #48

Closed but1head closed 5 years ago

but1head commented 5 years ago

Hi, i added support for postgres arrays.

# model.js
categories: {
     type: DataTypes.ARRAY(DataTypes.INTEGER),
     defaultValue: [],
}

# generated migration
"categories": {
     "type": Sequelize.ARRAY(Sequelize.INTEGER),
     "field": "categories",
     "defaultValue": Sequelize.Object
}

# postgres ddl
CREATE TABLE "***" (
    ...
    categories integer[],
   ...
);

works fine

but1head commented 5 years ago

Up...