Skip to content

Commit ec06817

Browse files
heiytorotavio
authored andcommitted
fix(api): remove redundant CreateCollection method
MongoDB automatically creates collections when inserting documents into non-existent collections, making the explicit CreateCollection call unnecessary. Removing this method eliminates potential errors from multiple executions.
1 parent ee5341f commit ec06817

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

api/store/mongo/migrations/migration_91.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ var migration91 = migrate.Migration{
2020
"action": "Up",
2121
}).Info("Applying migration")
2222

23-
if err := db.CreateCollection(ctx, "sessions_events"); err != nil {
24-
return err
25-
}
26-
2723
sessionIndex := mongo.IndexModel{
2824
Keys: bson.M{
2925
"session": 1,

0 commit comments

Comments
 (0)