Skip to content

Commit d033238

Browse files
AchoArnoldCopilot
andcommitted
chore: remove old heartbeats index drop code
The old indexes (owner_1_timestamp_-1, user_id_1) have already been dropped in production, so this migration code is no longer needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3a6429d commit d033238

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

api/pkg/repositories/mongodb.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ func createMongoIndexes(ctx context.Context, db *mongo.Database) error {
107107
// Heartbeats indexes
108108
heartbeatsCol := db.Collection(collectionHeartbeats)
109109

110-
// TODO: Remove this block after deploying once — old indexes will have been dropped in production.
111-
for _, name := range []string{"owner_1_timestamp_-1", "user_id_1"} {
112-
_ = heartbeatsCol.Indexes().DropOne(ctx, name)
113-
}
114-
115110
_, err := heartbeatsCol.Indexes().CreateMany(ctx, []mongo.IndexModel{
116111
{Keys: bson.D{{"user_id", 1}, {"owner", 1}, {"timestamp", -1}}},
117112
})

0 commit comments

Comments
 (0)