Reputation: 847
My co-worker have created a complex database in Postgres, and I'm trying define all the models automatically using Sequelize and Sequelize-Auto.
This database have many schemas, but with Sequelize-auto I'm only can automatize the "public" schema.
How I could moving me to another schemas in sequelize-auto?
Upvotes: 0
Views: 759
Reputation: 3624
just add the schema to options sequelize.define('name', {attributes},{options}).
make sure that you defined the schema before creating your Model.
var Project = sequelize.define('project', {
title: Sequelize.STRING,
description: Sequelize.TEXT
},
{
schema: 'schema_name',
...
}
);
Upvotes: 1