singularity strikes again!
This commit is contained in:
parent
191ed410e4
commit
25013e7864
10
README.md
10
README.md
|
@ -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 (name, attrs) {
|
beforeDefine: function (columns, model) {
|
||||||
console.log(name);
|
model.tableName = 'MyPrefix' + model.name.plural;
|
||||||
console.log(attrs);
|
//model.schema = 'public';
|
||||||
attrs.tableName = 'MyPrefix' + attrs.tableName;
|
|
||||||
//attrs.schema = 'public';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue