How difficult would it be for those who add a required .sql update to put an extra insert into a dbupdates table at the end so that it's dead simple for scripts to know what version of the database the server's on?
required/pretend_items_update_2015-07-26.sql
Code:
ALTER TABLE `items` ADD COLUMN `augmentslot19`NOT NULL DEFAULT 0;
INSERT INTO `db_updates` (`id`, `date`, `desc`) VALUES (null, '7/26/2015', 'pretend items update');
Any script wanting to update the database to a newer version could:
Code:
SELECT * FROM `db_updates` WHERE `date`=(SELECT MAX(`date`) FROM `db_updates`);
The script doing the querying would get the most recent date that updates where applied, and which updates were applied on that day, in case there were multiples and not all were applied last time.
In the same vein, perhaps an addition could be made to world.exe in which passing an argument like --version would cause it to return its build date to STDOUT for a script to read. It could then make sure the database has all required (and optional) updates up through that date, instead of using the current date, in case the server's codebase is lagging behind.
Just some random thoughts to complement Akka's handy new auto-patcher to maybe alleviate some of the headache with making sure all required patches are applied.