Skip to content

Commit

Permalink
internal/postgres: populate version_map.go_mod_path
Browse files Browse the repository at this point in the history
The version_map.go_mod_path column is now populated in
UpsertVersionMap.

Updates golang/go#36811
Updates golang/go#37002
Updates golang/go#37106

Change-Id: I4e474d28bee67caf7625045082df46f93394f3f6
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/751269
Reviewed-by: Jonathan Amsterdam <jba@google.com>
  • Loading branch information
julieqiu committed May 21, 2020
1 parent 4eab8a3 commit a5b5fa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/discovery.go
Expand Up @@ -45,6 +45,7 @@ type VersionMap struct {
ModulePath string
RequestedVersion string
ResolvedVersion string
GoModPath string
Status int
Error string
}
Expand Down
5 changes: 4 additions & 1 deletion internal/postgres/version_map.go
Expand Up @@ -36,14 +36,16 @@ func (db *DB) UpsertVersionMap(ctx context.Context, vm *internal.VersionMap) (er
module_path,
requested_version,
resolved_version,
go_mod_path,
status,
error,
sort_version,
module_id)
VALUES($1,$2,$3,$4,$5,$6,$7)
VALUES($1,$2,$3,$4,$5,$6,$7,$8)
ON CONFLICT (module_path, requested_version)
DO UPDATE SET
module_path=excluded.module_path,
go_mod_path=excluded.go_mod_path,
requested_version=excluded.requested_version,
resolved_version=excluded.resolved_version,
status=excluded.status,
Expand All @@ -53,6 +55,7 @@ func (db *DB) UpsertVersionMap(ctx context.Context, vm *internal.VersionMap) (er
vm.ModulePath,
vm.RequestedVersion,
vm.ResolvedVersion,
vm.GoModPath,
vm.Status,
vm.Error,
sortVersion,
Expand Down

0 comments on commit a5b5fa4

Please sign in to comment.