weavejester / ragtime

Database-independent migration library
Eclipse Public License 1.0
610 stars 85 forks source link

Add hash to migrations IDs by default #71

Closed weavejester closed 9 years ago

weavejester commented 9 years ago

If the ID for a migration is not specified, the ID should default to the filename plus a hash of the file's content. This will prevent migrations with different content but the same filename from confusing the migration stack.

It will also allow for automatic rollbacks during development, if the rebase strategy is chosen. Changing the file in any way will change its ID, and Ragtime will be able to rollback the old migration and then apply the new one.

This may require some way of performing a manual rollback and discard of a migration if the migration errors when it's rolled back.

weavejester commented 9 years ago

In retrospect, this might make it too difficult to rollback migrations with problems.