diff options
| author | Julie Qiu <julie@golang.org> | 2021-03-25 13:07:28 -0400 |
|---|---|---|
| committer | Julie Qiu <julie@golang.org> | 2021-03-25 19:57:07 +0000 |
| commit | 101343b2dd9dbde2dcbdf934e05d636cba8b7a26 (patch) | |
| tree | c07d9499873ec5fdb79b8a5782d1c09b6e547a19 /internal/postgres/insert_module.go | |
| parent | b80d4dd39a545d302609dbc52e3dc3e7a6fc18ae (diff) | |
| download | go-x-pkgsite-101343b2dd9dbde2dcbdf934e05d636cba8b7a26.tar.xz | |
internal/postgres: remove documentation delete
The documentation rows for a given module no longer need to be deleted.
Instead, we are planning to recreate the documentation table by
inserting into new_documentation.
Change-Id: Ia32957fb7947e793d8f8972091d16995d70db04a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304749
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/postgres/insert_module.go')
| -rw-r--r-- | internal/postgres/insert_module.go | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go index e5ea8c42..80c32ce9 100644 --- a/internal/postgres/insert_module.go +++ b/internal/postgres/insert_module.go @@ -512,18 +512,6 @@ func insertDocs(ctx context.Context, db *database.DB, pathToDocs map[string][]*internal.Documentation) (err error) { defer derrors.WrapStack(&err, "insertDocs") - // 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 - } - var docValues []interface{} for _, path := range paths { unitID := pathToUnitID[path] |
