add additional Point type to the schema
This commit is contained in:
parent
e78fab6f5b
commit
d433ba7efe
|
@ -19,6 +19,7 @@ exports.initialize = function initializeSchema(schema, callback) {
|
||||||
|
|
||||||
schema.adapter = new MySQL(schema.client);
|
schema.adapter = new MySQL(schema.client);
|
||||||
schema.adapter.schema = schema;
|
schema.adapter.schema = schema;
|
||||||
|
|
||||||
// schema.client.query('SET TIME_ZONE = "+04:00"', callback);
|
// schema.client.query('SET TIME_ZONE = "+04:00"', callback);
|
||||||
schema.client.query('USE `' + s.database + '`', function (err) {
|
schema.client.query('USE `' + s.database + '`', function (err) {
|
||||||
if (err && err.message.match(/^unknown database/i)) {
|
if (err && err.message.match(/^unknown database/i)) {
|
||||||
|
@ -32,6 +33,11 @@ exports.initialize = function initializeSchema(schema, callback) {
|
||||||
});
|
});
|
||||||
} else callback();
|
} else callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// MySQL specific column types
|
||||||
|
schema.types = {
|
||||||
|
Point: function Point() {}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -528,6 +534,9 @@ function datatype(p) {
|
||||||
case 'Boolean':
|
case 'Boolean':
|
||||||
dt = 'TINYINT(1)';
|
dt = 'TINYINT(1)';
|
||||||
break;
|
break;
|
||||||
|
case 'Point':
|
||||||
|
dt = 'POINT';
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return dt;
|
return dt;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue