aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/postgres/insert_module.go')
-rw-r--r--internal/postgres/insert_module.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index d2d0a762..7ccc4d7b 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -697,6 +697,11 @@ func (db *DB) DeleteModule(ctx context.Context, modulePath, version string) (err
if _, err := db.db.Exec(ctx, stmt, modulePath, version); err != nil {
return err
}
+
+ if _, err = db.db.Exec(ctx, `DELETE FROM version_map WHERE module_path = $1 AND resolved_version = $2`, modulePath, version); err != nil {
+ return err
+ }
+
var x int
err = db.db.QueryRow(ctx, `SELECT 1 FROM modules WHERE module_path=$1 LIMIT 1`, modulePath).Scan(&x)
if err != sql.ErrNoRows || err == nil {