Andreas Israel
2005-03-16 10:56:52 UTC
Hello list,
for all who want to update their pot installation to versions newer than
1.3, I want to announce my enhancement for the update-table-syntax which
sebastian has still put in the repository.
Because of the change in the database tables, it is also neccessary to
transform some data, to use the 'weekday' and 'hour' features, which are
new since 1.3. I know it's a little late, but I recently updated my
installation and so I noticed it, that there is something missing in the
distributed files. sorry for that.
the sql:
1. UPDATE [accesslog_table] SET `hour`=HOUR( DATE_FORMAT( FROM_UNIXTIME(
timestamp ) , '%Y-%m-%d %H:%i:%s' ) );
2. UPDATE [accesslog_table] SET weekday=DAYOFWEEK( DATE_FORMAT(
FROM_UNIXTIME( timestamp ) , '%Y-%m-%d %H:%i:%s' ) );
3. UPDATE [accesslog_table] SET weekday=weekday-1;
4. UPDATE [visitors_table] SET `hour`=HOUR( DATE_FORMAT( FROM_UNIXTIME(
timestamp ) ,'%Y-%m-%d %H:%i:%s') );
5. UPDATE [visitors_table] SET weekday=DAYOFWEEK( DATE_FORMAT(
FROM_UNIXTIME( timestamp ) , '%Y-%m-%d %H:%i:%s' ) );
6. UPDATE [visitors_table] SET weekday=weekday-1;
You'll have to change [accesslog_table] and [visitors_table], so that it
fits your table names.
The above sql is only neccessary, when you are using the constraints
'weekday' or 'hour' as I understood the features, if you don't use these
constraints don't apply it.
Hope this helps someone
Andreas
for all who want to update their pot installation to versions newer than
1.3, I want to announce my enhancement for the update-table-syntax which
sebastian has still put in the repository.
Because of the change in the database tables, it is also neccessary to
transform some data, to use the 'weekday' and 'hour' features, which are
new since 1.3. I know it's a little late, but I recently updated my
installation and so I noticed it, that there is something missing in the
distributed files. sorry for that.
the sql:
1. UPDATE [accesslog_table] SET `hour`=HOUR( DATE_FORMAT( FROM_UNIXTIME(
timestamp ) , '%Y-%m-%d %H:%i:%s' ) );
2. UPDATE [accesslog_table] SET weekday=DAYOFWEEK( DATE_FORMAT(
FROM_UNIXTIME( timestamp ) , '%Y-%m-%d %H:%i:%s' ) );
3. UPDATE [accesslog_table] SET weekday=weekday-1;
4. UPDATE [visitors_table] SET `hour`=HOUR( DATE_FORMAT( FROM_UNIXTIME(
timestamp ) ,'%Y-%m-%d %H:%i:%s') );
5. UPDATE [visitors_table] SET weekday=DAYOFWEEK( DATE_FORMAT(
FROM_UNIXTIME( timestamp ) , '%Y-%m-%d %H:%i:%s' ) );
6. UPDATE [visitors_table] SET weekday=weekday-1;
You'll have to change [accesslog_table] and [visitors_table], so that it
fits your table names.
The above sql is only neccessary, when you are using the constraints
'weekday' or 'hour' as I understood the features, if you don't use these
constraints don't apply it.
Hope this helps someone
Andreas