From d433ba7efebc63c74204c3077a5e2b68734001ee Mon Sep 17 00:00:00 2001 From: Sascha Gehlich Date: Sun, 16 Dec 2012 14:27:30 +0100 Subject: [PATCH] add additional Point type to the schema --- lib/mysql.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/mysql.js b/lib/mysql.js index 8192336..c606211 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -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; }