Skip to content

Commit 4692420

Browse files
kumfoLinkinStars
authored andcommitted
fix(update): fix update to v1.3.6
1 parent 629f981 commit 4692420

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

internal/migrations/migrations.go

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ var migrations = []Migration{
9696
NewMigration("v1.2.1", "add password login control", addPasswordLoginControl, true),
9797
NewMigration("v1.2.5", "add notification plugin and theme config", addNotificationPluginAndThemeConfig, true),
9898
NewMigration("v1.3.0", "add review", addReview, false),
99+
NewMigration("v1.3.6", "add hot score to question table", addQuestionHotScore, true),
99100
}
100101

101102
func GetMigrations() []Migration {

internal/migrations/v21.go

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package migrations
21+
22+
import (
23+
"context"
24+
"xorm.io/xorm"
25+
)
26+
27+
func addQuestionHotScore(ctx context.Context, x *xorm.Engine) error {
28+
type Question struct {
29+
HotScore int `xorm:"not null default 0 INT(11) hot_score"`
30+
}
31+
return x.Context(ctx).Sync(new(Question))
32+
}

0 commit comments

Comments
 (0)