Skip to content

Commit

Permalink
testing: fix TestUnconfirmedContractArchival
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Dec 19, 2023
1 parent f2c16ef commit 1917aed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stores/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,13 +779,13 @@ func (s *SQLStore) Contracts(ctx context.Context, opts api.ContractsOpts) ([]api
// fetch all contracts, their hosts and the contract set name
var dbContracts []struct {
Contract dbContract `gorm:"embedded"`
Host dbHost `gorm:"embedded,embeddedPrefix:Host__"`
Host dbHost `gorm:"embedded"`
Name string
}
err := s.db.
Model(&dbContract{}).
Select("contracts.*, Host.*, cs.name as Name").
Joins("Host").
Select("contracts.*, h.*, cs.name as Name").
Joins("INNER JOIN hosts h ON h.id = contracts.host_id").
Joins("LEFT JOIN contract_set_contracts csc ON csc.db_contract_id = contracts.id").
Joins("LEFT JOIN contract_sets cs ON cs.id = csc.db_contract_set_id").
Order("contracts.id ASC").
Expand Down

0 comments on commit 1917aed

Please sign in to comment.