Sorunome / mx-puppet-bridge

Puppeting library for matrix
Apache License 2.0
95 stars 29 forks source link

Improve database migrations #96

Open dsonck92 opened 2 years ago

dsonck92 commented 2 years ago

The current database migration system, while functional, is rather crudely built. There are several problems with it:

At least for Postgres, if you run the migration in a transaction, you know that any error will rollback the actual changes you proposed, bypassing the need for rollback.

The proposal:

Caveat: I'm not sure how well this is supported by sqlite. However, in its defense, sqlite will have much less connection issues, so only a migration bug could cause issues.

Sorunome commented 2 years ago

shine apparently had a look at exactly this for work (well, not with mx-puppet-bridge, but a different project which uses the exact same schema upgrades)