No cool pictures to show today but I think there's something very cool for behind the scenes, and that's that I've built a tool for managing database migrations.
As we develop online games there's many smaller updates and changes that we want to make to the database, and we need a way to store and edit those so everyone and the databases remain in sync.
The most straightforward way is make every change a SQL file, and then we just work through, applying them in order till we are up to date. The gsMigrator tool does just that, with a few extra features for safety and reliability.
One is being able to revert changes. Each SQL file can be paired with another that will revert it, assuming it's changes can be reverted, and developers are not too lazy to create it.
The other feature is optional transactions. By default the SQL of a file is ran in a single transaction, so if anything breaks, the whole thing will be rolled back to be corrected and reattempted. This is very useful and makes things much safer as we won't end up with half applied changes. The problem is sometimes we don't want a transaction as it stops some other cool things from working. Index creation can take a looooong time if you have a lot of data, so there is the option to build them in the background, but this is not allowed when you are in a transaction. So i've added support to turn off transactions if there is a special comment on the first line of the SQL file.
Previous: Setup auto post to mastodon