mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-22 01:34:18 +00:00
[CHORE] Remove Microsoft SQL Server Support
- Per https://codeberg.org/forgejo/discussions/issues/122
This commit is contained in:
parent
af47c583b4
commit
2d9afd0c21
70 changed files with 70 additions and 789 deletions
|
@ -39,12 +39,8 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi
|
|||
// Group by 15 minute intervals which will allow the client to accurately shift the timestamp to their timezone.
|
||||
// The interval is based on the fact that there are timezones such as UTC +5:30 and UTC +12:45.
|
||||
groupBy := "created_unix / 900 * 900"
|
||||
groupByName := "timestamp" // We need this extra case because mssql doesn't allow grouping by alias
|
||||
switch {
|
||||
case setting.Database.Type.IsMySQL():
|
||||
if setting.Database.Type.IsMySQL() {
|
||||
groupBy = "created_unix DIV 900 * 900"
|
||||
case setting.Database.Type.IsMSSQL():
|
||||
groupByName = groupBy
|
||||
}
|
||||
|
||||
cond, err := activityQueryCondition(ctx, GetFeedsOptions{
|
||||
|
@ -67,7 +63,7 @@ func getUserHeatmapData(ctx context.Context, user *user_model.User, team *organi
|
|||
Table("action").
|
||||
Where(cond).
|
||||
And("created_unix > ?", timeutil.TimeStampNow()-31536000).
|
||||
GroupBy(groupByName).
|
||||
GroupBy("timestamp").
|
||||
OrderBy("timestamp").
|
||||
Find(&hdata)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue