Add changelog and migration

This commit is contained in:
JakobDev 2024-05-03 14:00:35 +02:00
parent 825a1de918
commit dd01e85ce7
No known key found for this signature in database
GPG key ID: 39DEF62C3ED6DC4C
3 changed files with 38 additions and 0 deletions

View file

@ -66,6 +66,8 @@ var migrations = []*Migration{
NewMigration("Add `hide_archive_links` column to `release` table", AddHideArchiveLinksToRelease),
// v14 -> v15
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.

View 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{})
}

View file

@ -0,0 +1 @@
Add star lists