aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module.go
diff options
context:
space:
mode:
authorJonathan Amsterdam <jba@google.com>2021-05-13 15:44:26 -0400
committerJonathan Amsterdam <jba@google.com>2021-05-13 19:53:27 +0000
commit759af54b13ffc0b38a297c7bcd51d169ea0eba84 (patch)
tree06b9f5cc1af879910542003e61fbc8060f7c2e42 /internal/postgres/insert_module.go
parentde482c9493975c79620e3be09183b858d71d2088 (diff)
downloadgo-x-pkgsite-759af54b13ffc0b38a297c7bcd51d169ea0eba84.tar.xz
internal/postgres: remove delete from documentation
Don't delete old rows from the documentation table. Change-Id: Idd2e7d5fc02887f0fdcea4c2297b4bd499bd8ad4 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319909 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/postgres/insert_module.go')
-rw-r--r--internal/postgres/insert_module.go13
1 files changed, 0 insertions, 13 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index 89ce8354..219d1a1e 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -500,19 +500,6 @@ func insertDocs(ctx context.Context, db *database.DB,
pathToDocs map[string][]*internal.Documentation) (err error) {
defer derrors.WrapStack(&err, "insertDocs(%d paths)", len(paths))
- // Remove old rows before inserting new ones, to get rid of obsolete rows.
- // This is necessary because of the change to use all/all to represent documentation
- // that is the same for all build contexts. It can be removed once all the DBs have
- // been updated.
- var unitIDs []int
- for _, path := range paths {
- unitIDs = append(unitIDs, pathToUnitID[path])
- }
- if _, err := db.Exec(ctx, `DELETE FROM documentation WHERE unit_id = ANY($1)`,
- pq.Array(unitIDs)); err != nil {
- return err
- }
-
generateRows := func() chan database.RowItem {
ch := make(chan database.RowItem)
go func() {