Merge pull request #170 from saschagehlich/additional_types
add additional types stored in Schema.types to schema context
This commit is contained in:
commit
b7a3b297e7
|
@ -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