migration for sub
Some checks are pending
Release X-UI / build (386) (push) Waiting to run
Release X-UI / build (amd64) (push) Waiting to run
Release X-UI / build (arm64) (push) Waiting to run
Release X-UI / build (armv5) (push) Waiting to run
Release X-UI / build (armv6) (push) Waiting to run
Release X-UI / build (armv7) (push) Waiting to run
Release X-UI / build (s390x) (push) Waiting to run
Release X-UI / Build for Windows (push) Waiting to run

This commit is contained in:
Alireza Ahmadi 2026-06-21 15:15:23 +02:00
parent 5b8e644b93
commit c0fb611fa0
2 changed files with 16 additions and 0 deletions

View file

@ -9,6 +9,7 @@ const (
VersionRouting = 3
VersionInbound = 4
VersionPolicy = 5
VersionSettings = 6
)
type migration struct {
@ -21,6 +22,7 @@ var registry = []migration{
{VersionRouting, migrateV003Routing},
{VersionInbound, migrateV004Inbound},
{VersionPolicy, migrateV005Policy},
{VersionSettings, migrateV006Settings},
}
func Run(db *gorm.DB) error {

View file

@ -0,0 +1,14 @@
package migrations
import (
"github.com/alireza0/x-ui/logger"
"gorm.io/gorm"
)
func migrateV006Settings(db *gorm.DB) error {
db.Exec(`DELETE FROM settings WHERE key IN ('subJsonNoise','subJsonNoises', 'subJsonFragment')`)
logger.Info("Migrated settings to v6")
return nil
}