eca929f680
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Failing after 5s
PR RC Release / Build RC Release (pull_request) Failing after 18s
Branch Cleanup / Delete merged branch (pull_request) Has been skipped
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
#406: Add KeyPrefix field to UpdateStreamConfig. GenerateKeyString now accepts a prefix parameter, looked up from org config. Default remains MOKO if not set. Auto-uppercased, max 20 chars. #408: Move "New Package" button into the packages header bar, right-aligned. Uses details/summary pattern — clicking the button expands the create form below. Cleaner layout on both repo and org. #409: Add open-in-new-tab button (external link icon) next to every copy button on feed URLs. All four feeds: Joomla XML, Dolibarr JSON, WordPress JSON, Changelog XML. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
81 lines
2.6 KiB
Go
81 lines
2.6 KiB
Go
// Copyright 2026 Moko Consulting <hello@mokoconsulting.tech>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package v1_27
|
|
|
|
import (
|
|
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/timeutil"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
// licenseKey340 adds columns that were introduced after v335/v337.
|
|
type licenseKey340 struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
KeyRaw string `xorm:"TEXT"`
|
|
PaymentRef string `xorm:""`
|
|
LastHeartbeatUnix timeutil.TimeStamp `xorm:"NOT NULL DEFAULT 0"`
|
|
FirstUsedUnix timeutil.TimeStamp `xorm:"NOT NULL DEFAULT 0"`
|
|
}
|
|
|
|
func (licenseKey340) TableName() string {
|
|
return "license_key"
|
|
}
|
|
|
|
// licensePackage340 adds the IsArchived and DomainLockHours columns.
|
|
type licensePackage340 struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
IsArchived bool `xorm:"NOT NULL DEFAULT false"`
|
|
DomainLockHours int `xorm:"NOT NULL DEFAULT 0"`
|
|
}
|
|
|
|
func (licensePackage340) TableName() string {
|
|
return "license_package"
|
|
}
|
|
|
|
// updateStreamConfig340 adds licensing, gating, and extension metadata columns.
|
|
type updateStreamConfig340 struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
LicensingEnabled bool `xorm:"NOT NULL DEFAULT false"`
|
|
FeedVisibility string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'public'"`
|
|
DownloadGating string `xorm:"VARCHAR(20) NOT NULL DEFAULT 'none'"`
|
|
SupportURL string `xorm:"TEXT"`
|
|
ExtensionName string `xorm:"TEXT"`
|
|
DisplayName string `xorm:"TEXT"`
|
|
Description string `xorm:"TEXT"`
|
|
ExtensionType string `xorm:"VARCHAR(50)"`
|
|
Maintainer string `xorm:"TEXT"`
|
|
MaintainerURL string `xorm:"TEXT"`
|
|
InfoURL string `xorm:"TEXT"`
|
|
TargetVersion string `xorm:"TEXT"`
|
|
PHPMinimum string `xorm:"VARCHAR(20)"`
|
|
KeyPrefix string `xorm:"VARCHAR(20)"`
|
|
}
|
|
|
|
func (updateStreamConfig340) TableName() string {
|
|
return "update_stream_config"
|
|
}
|
|
|
|
// releaseStreamMap340 creates the release-to-stream manual mapping table.
|
|
type releaseStreamMap340 struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
ReleaseID int64 `xorm:"UNIQUE NOT NULL INDEX"`
|
|
RepoID int64 `xorm:"NOT NULL INDEX"`
|
|
StreamName string `xorm:"NOT NULL"`
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"`
|
|
}
|
|
|
|
func (releaseStreamMap340) TableName() string {
|
|
return "release_stream_map"
|
|
}
|
|
|
|
// SyncLicenseSystemColumns adds missing columns and creates new tables.
|
|
func SyncLicenseSystemColumns(x *xorm.Engine) error {
|
|
return x.Sync(
|
|
new(licenseKey340),
|
|
new(licensePackage340),
|
|
new(updateStreamConfig340),
|
|
new(releaseStreamMap340),
|
|
)
|
|
}
|