Skip to content

Commit

Permalink
internal/postgres: change ON CONFLICT key in insertLicenses
Browse files Browse the repository at this point in the history
insertLicenses now uses licenses (module_id, file_path) as the ON
CONFLICT key.

For golang/go#39629

Change-Id: Ib85a61f538a176c1bfff7a070121162405ef21dc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/265241
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
  • Loading branch information
julieqiu committed Oct 27, 2020
1 parent b8a5f33 commit 807ebae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/postgres/insert_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func insertLicenses(ctx context.Context, db *database.DB, m *internal.Module, mo
"module_id",
}
return db.BulkUpsert(ctx, "licenses", licenseCols, licenseValues,
[]string{"module_path", "version", "file_path"})
[]string{"module_id", "file_path"})
}
return nil
}
Expand Down

0 comments on commit 807ebae

Please sign in to comment.