Skip to content

Commit

Permalink
fix compatibility heatmap with mysql 8 (#5232)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav authored and techknowlogick committed Oct 31, 2018
1 parent 7edb930 commit 794049e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/user_heatmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func GetUserHeatmapDataByUser(user *User) ([]*UserHeatmapData, error) {
case setting.UseSQLite3:
groupBy = "strftime('%s', strftime('%Y-%m-%d', created_unix, 'unixepoch'))"
case setting.UseMySQL:
groupBy = "UNIX_TIMESTAMP(DATE_FORMAT(FROM_UNIXTIME(created_unix), '%Y%m%d'))"
groupBy = "UNIX_TIMESTAMP(DATE(FROM_UNIXTIME(created_unix)))"
case setting.UsePostgreSQL:
groupBy = "extract(epoch from date_trunc('day', to_timestamp(created_unix)))"
case setting.UseMSSQL:
Expand Down

0 comments on commit 794049e

Please sign in to comment.