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