singularity strikes again!

This commit is contained in:
AJ ONeal 2019-05-09 01:04:08 -06:00
parent 191ed410e4
commit 25013e7864
1 changed files with 4 additions and 8 deletions

View File

@ -124,14 +124,10 @@ you can do so like this:
var Sequelize = require('sequelize'); var Sequelize = require('sequelize');
var databaseUrl = process.env['DATABASE_URL']; var databaseUrl = process.env['DATABASE_URL'];
var db = new Sequelize(databaseUrl, { var db = new Sequelize(databaseUrl, {
define: { hooks: {
hooks: { beforeDefine: function (columns, model) {
beforeDefine: function (name, attrs) { model.tableName = 'MyPrefix' + model.name.plural;
console.log(name); //model.schema = 'public';
console.log(attrs);
attrs.tableName = 'MyPrefix' + attrs.tableName;
//attrs.schema = 'public';
}
} }
} }
}); });