]> source.dussan.org Git - gitea.git/commitdiff
fix compatibility heatmap with mysql 8 (#5232)
authorStanislav <me@gaydin.io>
Wed, 31 Oct 2018 20:56:32 +0000 (23:56 +0300)
committertechknowlogick <hello@techknowlogick.com>
Wed, 31 Oct 2018 20:56:32 +0000 (16:56 -0400)
models/user_heatmap.go

index a86ae39fce1f749b7c4d001cb52eeb8a6583b188..f9575ed50fc4f14121e90cbe86c0a1f171f52f86 100644 (file)
@@ -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: