[DB] forgejo migration v2: create the forgejo_sem_ver table
(cherry picked from commit 86b26436af
)
Conflicts:
models/forgejo_migrations/migrate.go
trivial context conflict
This commit is contained in:
parent
1ffddf75d6
commit
2605e121d4
2 changed files with 17 additions and 0 deletions
|
@ -37,6 +37,8 @@ func NewMigration(desc string, fn func(*xorm.Engine) error) *Migration {
|
||||||
// Add new migrations to the bottom of the list.
|
// Add new migrations to the bottom of the list.
|
||||||
var migrations = []*Migration{
|
var migrations = []*Migration{
|
||||||
NewMigration("Add Forgejo Blocked Users table", forgejo_v1_20.AddForgejoBlockedUser),
|
NewMigration("Add Forgejo Blocked Users table", forgejo_v1_20.AddForgejoBlockedUser),
|
||||||
|
// v2 -> v3
|
||||||
|
NewMigration("create the forgejo_sem_ver table", forgejo_v1_20.CreateSemVerTable),
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentDBVersion returns the current Forgejo database version.
|
// GetCurrentDBVersion returns the current Forgejo database version.
|
||||||
|
|
15
models/forgejo_migrations/v1_20/v2.go
Normal file
15
models/forgejo_migrations/v1_20/v2.go
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package forgejo_v1_20 //nolint:revive
|
||||||
|
|
||||||
|
import (
|
||||||
|
"xorm.io/xorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CreateSemVerTable(x *xorm.Engine) error {
|
||||||
|
type ForgejoSemVer struct {
|
||||||
|
Version string
|
||||||
|
}
|
||||||
|
|
||||||
|
return x.Sync(new(ForgejoSemVer))
|
||||||
|
}
|
Loading…
Reference in a new issue