23 May 2008
This post may be outdated due to it was written on 2008. The links may be broken. The code may be not working anymore. Leave comments if needed.
well, don't use DATETIME or DATE in database for time, use INT(11) UNSIGNED instead.

the benefits are:
1, u don't need care about MySQL or SQLite or others. NOW() is used by MySQL while CURRENT_TIMESTAMP is used by SQLite. that's important while u developer in MySQL and write test cases by SQLite.
2, compare. while in TT, if u want to compare topic.time with date.now, u need wrap date.now by String.Compare or convert topic.time to int. that's not so easy. and date.format can convert INT to any format u want.

I spent some hours to do the upgrade for Foorum.
and the upgrade pl is simple: create a temp column then update as UNIX_TIMESTAMP, then drop old column and rename temp column.

code is here: http://foorum.googlecode.com/svn/trunk/bin/upgrade/0.1.5/up.pl

Enjoy.


blog comments powered by Disqus