add a hackish migration for the changes expiration index.

This commit is contained in:
2020-08-09 15:35:33 +02:00
parent 5dbed6d632
commit 757b0bc616
+3
View File
@@ -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"},