add additional types stored in Schema.types to schema context
This commit is contained in:
parent
9fed918db8
commit
53e2dcf30b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue