Merge pull request #1 from saschagehlich/additional_types

add additional Point type to the schema
This commit is contained in:
Anatoliy Chakkaev 2012-12-16 10:09:07 -08:00
commit 6366736b02
1 changed files with 9 additions and 0 deletions

View File

@ -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;
}