diff --git a/lib/railway.js b/lib/railway.js index bc54a920..d8ac0203 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -201,6 +201,15 @@ function prepareContext(models, railway, app, defSchema, done) { if (cname) settings[cname].table = name; }; + /** + * If the Schema has additional types, add them to the context + * e.g. MySQL has an additional Point type + */ + if (Schema.types && Object.keys(Schema.types).length) { + for (var typeName in Schema.types) { + ctx[typeName] = Schema.types[typeName]; + } + } ctx.Text = Schema.Text; return ctx;