rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.23k stars 280 forks source link

Fix a race condition in the sql-migrate memory migration struct #96

Closed ironsmile closed 6 years ago

ironsmile commented 6 years ago

Concurrent usage of the MemoryMigrationSource was impossible because it was mutating its Migrations property in place. This commit makes this possible by making sure the FindMigrations sorts a copy of the migrations list instead of the shared one.

rubenv commented 6 years ago

Good catch, thanks!