michaelklishin/monger — pull request #57 by dobladez (2013-07-05 19:31:00+00:00)
Title: Fix:  must return ids in creation order

As I started adding some migrations, I started to get migration conflict exceptions coming from ragtime, like the following:
```
java.lang.Exception: Conflict! Expected {:id "default-admin-user-is-system-user", :up #, :down #} but {:id "fieldsmeta-roles-descriptions", :up #, :down #} was applied.
at ragtime.strategy$raise_error.invoke(strategy.clj:40)
```

I traced it down to monger.ragtime/applied-migration-ids not preserving insertion order of the Ids.

The code runs a query for the ids sorting by creation time. However, it puts the results into a `set`, effectively loosing the ordering.

I added a test case and changed it to return a vector instead.

Note: This *might* break some client code compatibility... but I'd argue there's a low chance of that happening since this is mostly an internal protocol used by ragtime. And I'd say it's a good time now given the 1.6.0 release.

Thanks