diff --git a/lib/railway.js b/lib/railway.js index 3fd83534..8d2ae77c 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -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(); + } else { + schema.freeze(); + } }); }