8/6-23: first draft
This post is about methods for analysing a problems that can be solved with algorithms. As a part of making my project Personal Budget 2 (link), i am making some tools for migrating the database up and down between versions, and also resetting the database entirely, without sacrificing the data stored at reset time.
One of these tools need to populate tables after the database has been reset, and here i encounter the problem of defining the right order of inputting data when there is foreign key relationships between tables constraining the order of inserting the data.
This problem of making a backup and restoring the database afterwards is most likely something i could find an open source tool for, but i decided to take up the challenge. This also was a great opportunity to improve my skills in bash programming, postgresql and database management and also some basic datastructures and algorithm design.
The problem:
fkey con
tablenames
data
building a tree
traversing and populating tree
Solution/analysis:
making decision table
Implementation:
how is it to program on the basis of decision table??