[MySQL or SQLite] Schema suggestions for recording groups of N items

So I have a python3 script that does a series of tasks against another system, each task returning a string. All of the tasks are run sequentially as a batch, and I am running the whole batch against a growing number of systems.

Currently, I am recording my results in SQLite3 with one row per batch, with a timestamp, an id, and a column dedicated to each specific task's result. I hate this model because it doesn't let me grow or change the task list without adding a column to the DB, which usually requires a bit of work on the web app that consumes this data.

Any suggestions how I can structure my database to let me add tasks more easily? All I can think of is a table that just records task definitions, a table for the results of all tasks with the result string and the task id, and another with a column for task id and batch id. This sounds cumbersome, and I feel like there should be a better way.

Posted Feb 22, 2016, 5:51 AM UTC

32
Loading comments…