Maybe this is more a database related question, then a sqlalchemy question. Never try never know.

I am building a point of sale application based on sqlalchemy. To keep things organized, we keep a log of changes on some tables like orders, products, stocks.

Let's take stocks in this example. If we have a stock of 20 from product x at this moment, I would like to be able to see two things:

- What was the stock of product x total 36 hours ago
- What happended to the stock of product x in the last two weeks, who made changes?

And for an order
- What did the order look like 3 days ago

What we could do is set up a logtable for each table we want to track and save all values on a change (with a server side trigger) plus the person responsible. This way we have to design a lot of custom tables for each table we want to check, and write the functions accordingly.

So I was thinking if there already was a "right way©" to do this. It should be a fairly common problem, so maybe there is a standard solution.

Thanks,

Koen

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to