internal/postgres: remove delete from documentation
Don't delete old rows from the documentation table.
Trust: Jonathan Amsterdam
Run-TryBot: Jonathan Amsterdam
@@ -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() {
