clean up changes
This commit is contained in:
@@ -247,7 +247,7 @@ func migrateTls(db *gorm.DB) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for key, _ := range tlsClient {
|
for key := range tlsClient {
|
||||||
switch key {
|
switch key {
|
||||||
case "insecure", "disable_sni", "utls", "ech", "reality":
|
case "insecure", "disable_sni", "utls", "ech", "reality":
|
||||||
continue
|
continue
|
||||||
@@ -291,6 +291,10 @@ func migrateClients(db *gorm.DB) error {
|
|||||||
return db.Save(oldClients).Error
|
return db.Save(oldClients).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func migrateChanges(db *gorm.DB) error {
|
||||||
|
return db.Migrator().DropColumn(&model.Changes{}, "index")
|
||||||
|
}
|
||||||
|
|
||||||
func to1_2(db *gorm.DB) error {
|
func to1_2(db *gorm.DB) error {
|
||||||
err := moveJsonToDb(db)
|
err := moveJsonToDb(db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -304,5 +308,9 @@ func to1_2(db *gorm.DB) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return migrateClients(db)
|
err = migrateClients(db)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return migrateChanges(db)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ type Stats struct {
|
|||||||
type Changes struct {
|
type Changes struct {
|
||||||
Id uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
|
Id uint64 `json:"id" gorm:"primaryKey;autoIncrement"`
|
||||||
DateTime int64 `json:"dateTime"`
|
DateTime int64 `json:"dateTime"`
|
||||||
Actor string `json:"Actor"`
|
Actor string `json:"actor"`
|
||||||
Key string `json:"key" form:"key"`
|
Key string `json:"key"`
|
||||||
Action string `json:"action" form:"action"`
|
Action string `json:"action"`
|
||||||
Index uint `json:"index" form:"index"`
|
Obj json.RawMessage `json:"obj"`
|
||||||
Obj json.RawMessage `json:"obj" form:"obj"`
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user