|
|
@ -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"}, |
|
|
|