add a hackish migration for the changes expiration index.
This commit is contained in:
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user