mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-26 08:53:05 +00:00
remove last_successful_update error check (#1959)
most of the time we dont even check this error and checking the string for particular errors is very flake as different databases (sqlite and psql) use different error messages, and some users might have it in other languages. Fixes #1956 Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
51b56ba447
commit
5a4e52b727
1 changed files with 3 additions and 9 deletions
|
@ -319,14 +319,8 @@ func NewHeadscaleDatabase(
|
|||
// no longer used.
|
||||
ID: "202402151347",
|
||||
Migrate: func(tx *gorm.DB) error {
|
||||
err := tx.Migrator().DropColumn(&types.Node{}, "last_successful_update")
|
||||
if err != nil && strings.Contains(err.Error(), `of relation "nodes" does not exist`) {
|
||||
_ = tx.Migrator().DropColumn(&types.Node{}, "last_successful_update")
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
|
||||
return err
|
||||
},
|
||||
Rollback: func(tx *gorm.DB) error {
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue