app.enable('autoupdate') option support

This commit is contained in:
Asp3ctus 2013-01-08 15:34:59 +06:00
parent 5062beb99b
commit c78a4de375
1 changed files with 6 additions and 2 deletions

View File

@ -93,9 +93,13 @@ function loadSchema(schema, railway, app, models) {
fn(context, require);
}
// and freeze schemas
// autoupdate if set app.enable('autoupdate') or freeze schemas by default
railway.orm._schemas.forEach(function (schema) {
schema.freeze();
if(app.enabled('autoupdate')){
schema.autoupdate();
} esle {
schema.freeze();
}
});
}