mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-09 05:34:51 -05:00
Restore foreign keys and add constraints (#1562)
* fix #1482, restore foregin keys, add constraints * #1562, fix tests, fix formatting * #1562: fix tests * #1562: fix local run of test_integration
This commit is contained in:
@@ -197,9 +197,10 @@ func ValidatePreAuthKey(tx *gorm.DB, k string) (*types.PreAuthKey, error) {
|
||||
}
|
||||
|
||||
nodes := types.Nodes{}
|
||||
pakID := uint(pak.ID)
|
||||
if err := tx.
|
||||
Preload("AuthKey").
|
||||
Where(&types.Node{AuthKeyID: uint(pak.ID)}).
|
||||
Where(&types.Node{AuthKeyID: &pakID}).
|
||||
Find(&nodes).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user