mirror of
https://github.com/alireza0/x-ui.git
synced 2026-08-31 23:16:21 +00:00
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
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:
parent
5b8e644b93
commit
c0fb611fa0
2 changed files with 16 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
14
database/migrations/v006_settings.go
Normal file
14
database/migrations/v006_settings.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue