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