WIP: reduce abstraction #6
12
README.md
12
README.md
|
@ -124,14 +124,10 @@ you can do so like this:
|
|||
var Sequelize = require('sequelize');
|
||||
var databaseUrl = process.env['DATABASE_URL'];
|
||||
var db = new Sequelize(databaseUrl, {
|
||||
define: {
|
||||
hooks: {
|
||||
beforeDefine: function (name, attrs) {
|
||||
console.log(name);
|
||||
console.log(attrs);
|
||||
attrs.tableName = 'MyPrefix' + attrs.tableName;
|
||||
//attrs.schema = 'public';
|
||||
}
|
||||
hooks: {
|
||||
beforeDefine: function (columns, model) {
|
||||
model.tableName = 'MyPrefix' + model.name.plural;
|
||||
//model.schema = 'public';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue