internal/postgres: remove uses of modules.deprecated_comment
The deprecated_column in the modules table has been superseded by the
information in the latest_module_versions table.
For golang/go#43265
Change-Id: Ib53e0b295a3edf8e807ff825b36baa6701b927b1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309610
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/internal/postgres/details.go b/internal/postgres/details.go
index 29cc95a..3d6d65d 100644
--- a/internal/postgres/details.go
+++ b/internal/postgres/details.go
@@ -31,7 +31,6 @@
m.commit_time,
m.redistributable,
m.has_go_mod,
- m.deprecated_comment,
m.source_info
FROM
modules m
@@ -139,7 +138,6 @@
commit_time,
redistributable,
has_go_mod,
- deprecated_comment,
source_info
FROM
modules
@@ -193,18 +191,11 @@
// scanModuleInfo constructs an *internal.ModuleInfo from the given scanner.
func scanModuleInfo(scan func(dest ...interface{}) error) (*internal.ModuleInfo, error) {
- var (
- mi internal.ModuleInfo
- depComment *string
- )
+ var mi internal.ModuleInfo
if err := scan(&mi.ModulePath, &mi.Version, &mi.CommitTime,
- &mi.IsRedistributable, &mi.HasGoMod, &depComment, jsonbScanner{&mi.SourceInfo}); err != nil {
+ &mi.IsRedistributable, &mi.HasGoMod, jsonbScanner{&mi.SourceInfo}); err != nil {
return nil, err
}
- if depComment != nil {
- mi.Deprecated = true
- mi.DeprecationComment = *depComment
- }
return &mi, nil
}
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index ea2a4bd..732b64b 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -222,13 +222,7 @@
if err != nil {
return 0, err
}
- var (
- moduleID int
- depComment *string
- )
- if m.Deprecated {
- depComment = &m.DeprecationComment
- }
+ var moduleID int
err = db.QueryRow(ctx,
`INSERT INTO modules(
module_path,
@@ -240,9 +234,8 @@
source_info,
redistributable,
has_go_mod,
- deprecated_comment,
incompatible)
- VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)
+ VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)
ON CONFLICT
(module_path, version)
DO UPDATE SET
@@ -258,7 +251,6 @@
sourceInfoJSON,
m.IsRedistributable,
m.HasGoMod,
- depComment,
version.IsIncompatible(m.Version),
).Scan(&moduleID)
if err != nil {
diff --git a/internal/postgres/version.go b/internal/postgres/version.go
index 5f9329c..a1bed6d 100644
--- a/internal/postgres/version.go
+++ b/internal/postgres/version.go
@@ -55,7 +55,6 @@
m.commit_time,
m.redistributable,
m.has_go_mod,
- m.deprecated_comment,
m.source_info
FROM modules m
INNER JOIN units u