From c78a4de375b69de3a094b5ecf14ef63014da7df0 Mon Sep 17 00:00:00 2001 From: Asp3ctus Date: Tue, 8 Jan 2013 15:34:59 +0600 Subject: [PATCH 1/2] app.enable('autoupdate') option support --- lib/railway.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/railway.js b/lib/railway.js index 3fd83534..d81cd332 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(); + } esle { + schema.freeze(); + } }); } From 4f7ffb903eae588c0a7681ed6545f4c65f9e2cc2 Mon Sep 17 00:00:00 2001 From: Asp3ctus Date: Tue, 8 Jan 2013 15:37:58 +0600 Subject: [PATCH 2/2] fix typo :) --- lib/railway.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/railway.js b/lib/railway.js index d81cd332..8d2ae77c 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -97,7 +97,7 @@ function loadSchema(schema, railway, app, models) { railway.orm._schemas.forEach(function (schema) { if(app.enabled('autoupdate')){ schema.autoupdate(); - } esle { + } else { schema.freeze(); } });