Submissions by saluk tagged datamatters

A submission for Make games. 108

mybacklog

Ugh. My updates last night to sort out adding games made a permanent change to my database (that I had not backed up) that I had not anticipated. Before I started tweaking the data model, every game in the database was given a unique id which was based on where that game came from. If it came from steam, it's id was "steam_235345". If it came from humble, it was "humble_AAwqefAWYD2". If it was gog, it was "gog_x_wing_alliance". But I tweaked my data model to keep the source-specific id tucked away in the sources:[] field, instead using the game's name as it's unique identifier. After all, eventually there should only be one entry for the game in my database, with a sources:[steam_id,humble_id] etc.

I forgot about that when I fixed the adding games feature. I was just giving the new, added games a game id based on their name and shoving them in. The result? Upon importing my steam library, any game I have purchased from humble and redeemed with a key on steam wiped away the humble entries replacing them with the steam entries.

Painful. This is why I want to perfect the data model before letting anyone else use my tool :) Once it's set, it's better to leave it set.

For now, I can just fix the add function to check if it is changing the source, and keep them as separate entries.