Friday, July 07, 2006

A whoo-hoo. Yes.

The database has been recoded. And works great, it's clean, and it'll be much easier to use. I've still got to tackle the rather large and annoying problem that is rewriting the data editor in order to use the new code, but it won't take as long as it did to write it in the first place.

At the moment, I'm still adding a system of relationship links to the database. Essentially, these will allow you to link the field of one record to another table or group, the purpose of this being to get the database code to automatically clean things up when you make a big stink. For example, if I delete a player from the database, it will swiftly search through all the teams in the game to make sure that the player is removed from his club, through all the competitions to tell his disciplinary record to sod off and so on, thus avoiding horrible crashes that might have plagued the original system.

It's a wonderful theory, but it also threatens to undo the very universe with its irritating recursiveness. Remove a player and you remove his entry in a club. Remove that... and you might end up deleting something else, like an existing loan arrangement. Delete that, and it might go and mess up something else, which will screw up the upstairs landing and result in a cacophony of squirrels attempting to assault a banjo with creme de menthe. I've confused you, I know, but that's basically how I'm suffering just trying to sort out this ridiculous yet entirely necessary system.

It could, in theory, end up trying to delete the very thing you've deleted in the first place, setting off the entire chain reaction. If that's a record, that's no problem - the system doesn't shift records around when you delete one, so deleting record two won't move record three down. However it does shift entries in a dynamic group. If I remove Player 13 from a club, Player 14 will shift down to save memory. I don't particular want to delete that and end up destroying the universe, particularly as I've yet to visit some nice places in that universe.

It'll be done tomorrow if I don't gibber.

No comments: