Fabio,
On Wed, Jun 22, 2011 at 5:27 PM, Fabio Mascarenhas <[email protected]>wrote:
> Ryan,
>
> The master branch of Orbit (what the cvs-2 rockspec) pulls is not
> compatible with Orbit 2.2. I pushed the model and routes fixes to the
> orbit22 branch, this is what you should pull; you will need to edit
> the rockspec and add a cvs_tag = "orbit22" field to the sources table.
>
> I will do a maintenance release the orbit22 branch to address this bug.
>
Great thanks.
I was also wondering if you think it is appropriate to add 2 lines to
'model.lua' to allow the "timestamp" data type?
Below I pasted the two functions and the one line that adds support for
timestamp. This would be in Orbit 2.2.
<code>
function convert.datetime(v)
local year, month, day, hour, min, sec =
string.match(v, "(%d+)%-(%d+)%-(%d+) (%d+):(%d+):(%d+)")
return os.time({ year = tonumber(year), month = tonumber(month),
day = tonumber(day), hour = tonumber(hour),
min = tonumber(min), sec = tonumber(sec) })
end
-- Add support for timestamp
convert.timestamp = convert.datetime
-- ...
function escape.datetime(v)
return "'" .. os.date("%Y-%m-%d %H:%M:%S", v) .. "'"
end
-- Add support for timestamp
escape.timestamp = escape.datetime
</code>
Thoughts?
P.S. The reason to add this support is because I like that the MySQL
database will auto update these with the latest timestamp using the ON
UPDATE event, but won't allow that for datetime.
--
Regards,
Ryan
_______________________________________________
Kepler-Project mailing list
[email protected]
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/