Browse Source

add a hackish migration for the changes expiration index.

thegreatrefactor
Gisle Aune 4 years ago
parent
commit
757b0bc616
  1. 3
      database/mongodb/changes.go

3
database/mongodb/changes.go

@ -80,6 +80,9 @@ func (r *changeRepository) Remove(ctx context.Context, change models.Change) err
func newChangeRepository(db *mgo.Database) (repositories.ChangeRepository, error) {
collection := db.C("common.changes")
// Delete the old index if it exists.
_ = collection.DropIndexName("date_1")
err := collection.EnsureIndex(mgo.Index{
Name: "expiry",
Key: []string{"date"},

Loading…
Cancel
Save