[CHORE] Remove Microsoft SQL Server Support

- Per https://codeberg.org/forgejo/discussions/issues/122
This commit is contained in:
Gusted 2024-04-04 18:02:24 +02:00
parent af47c583b4
commit 2d9afd0c21
No known key found for this signature in database
GPG key ID: FD821B732837125F
70 changed files with 70 additions and 789 deletions

View file

@ -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)
}