Database Migrations
jacobheath opened this issue · 5 comments
It would be nice for upgrades to tracy to automatically apply database migrations so that users wouldn't need to delete their database when updating to the lastest binary.
@bennyncc
It appears the errors being thrown by AutoMigration
are not being thrown. Saw them finally when running go run main.go --debug-ui -v
. Might just need to change code here: https://github.com/nccgroup/tracy/blob/master/api/store/sqlite.go#L30 so that any errors are immediately thrown. Also need to add default value for reason
column to solve this particular problem.
What would be the proposed solution for when an error is thrown? Should tracy create a new database file since the migration can't happen with new fields that are not null?
Closed in 4016ddc
If a user of Tracy is on a long running project where they have many saved tracers, they should be able to upgrade to a new version of Tracy without losing all of that data. I propose that errors are just thrown, and a small amount of testing is done for version upgrades when database schema changes are made to ensure that migrations happen smoothly during the upgrade.