mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-26 13:40:09 +00:00
Add changelog and migration
This commit is contained in:
parent
825a1de918
commit
dd01e85ce7
3 changed files with 38 additions and 0 deletions
|
@ -66,6 +66,8 @@ var migrations = []*Migration{
|
||||||
NewMigration("Add `hide_archive_links` column to `release` table", AddHideArchiveLinksToRelease),
|
NewMigration("Add `hide_archive_links` column to `release` table", AddHideArchiveLinksToRelease),
|
||||||
// v14 -> v15
|
// v14 -> v15
|
||||||
NewMigration("Remove Gitea-specific columns from the repository and badge tables", RemoveGiteaSpecificColumnsFromRepositoryAndBadge),
|
NewMigration("Remove Gitea-specific columns from the repository and badge tables", RemoveGiteaSpecificColumnsFromRepositoryAndBadge),
|
||||||
|
// v15 -> v16
|
||||||
|
NewMigration("Add star lists", AddStarLists),
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetCurrentDBVersion returns the current Forgejo database version.
|
// GetCurrentDBVersion returns the current Forgejo database version.
|
||||||
|
|
35
models/forgejo_migrations/v15.go
Normal file
35
models/forgejo_migrations/v15.go
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package forgejo_migrations //nolint:revive
|
||||||
|
|
||||||
|
import (
|
||||||
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
|
|
||||||
|
"xorm.io/xorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
func AddStarLists(x *xorm.Engine) error {
|
||||||
|
type StarList struct {
|
||||||
|
ID int64 `xorm:"pk autoincr"`
|
||||||
|
UserID int64 `xorm:"INDEX UNIQUE(name)"`
|
||||||
|
Name string `xorm:"INDEX UNIQUE(name)"`
|
||||||
|
Description string
|
||||||
|
IsPrivate bool
|
||||||
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||||
|
}
|
||||||
|
|
||||||
|
err := x.Sync(&StarList{})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
type StarListRepos struct {
|
||||||
|
ID int64 `xorm:"pk autoincr"`
|
||||||
|
StarListID int64 `xorm:"INDEX UNIQUE(repo)"`
|
||||||
|
RepoID int64 `xorm:"INDEX UNIQUE(repo)"`
|
||||||
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
|
||||||
|
}
|
||||||
|
|
||||||
|
return x.Sync(&StarListRepos{})
|
||||||
|
}
|
1
release-notes/8.0.0/feat/3621.md
Normal file
1
release-notes/8.0.0/feat/3621.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Add star lists
|
Loading…
Reference in a new issue