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>
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index 89ce835..219d1a1 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -500,19 +500,6 @@
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() {