Skip to content

Commit ada0598

Browse files
committed
internal/postgres: truncate raw_latest_versions
For golang/go#43265 For golang/go#41321 Change-Id: I7bf803b68b1532b968ad1175433275f5a4778078 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296812 Trust: Jonathan Amsterdam <[email protected]> Run-TryBot: Jonathan Amsterdam <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Julie Qiu <[email protected]>
1 parent 681ee9a commit ada0598

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

internal/postgres/test_helper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ func ResetTestDB(db *DB, t *testing.T) {
113113
TRUNCATE version_map;
114114
TRUNCATE paths CASCADE;
115115
TRUNCATE symbol_names CASCADE;
116-
TRUNCATE imports_unique;`); err != nil {
116+
TRUNCATE imports_unique;
117+
TRUNCATE raw_latest_versions;`); err != nil {
117118
return err
118119
}
119120
if _, err := tx.Exec(ctx, `TRUNCATE module_version_states CASCADE;`); err != nil {

internal/postgres/version.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ func (db *DB) UpdateRawLatestInfo(ctx context.Context, info *internal.RawLatestI
320320
}
321321
}
322322

323+
log.Debugf(ctx, "updating raw latest from %q to %q", curVersion, info.Version)
323324
return upsertRawLatestInfo(ctx, tx, id, info)
324325
})
325326
}

0 commit comments

Comments
 (0)