Collapse migrations. Fixes #1344