Tag Info

Hot answers tagged

8

The technique I have normally used is to save the complete record, with an end_timestamp field. There is a business rule that only one row can have a null end_timestamp, and this is of course the currently active content. If you adopt this system, I strongly recommend you add an index or constraint to enforce the rule. This is easy with Oracle, as a unique ...


6

Note that if you use Microsoft SQL Server, there is already a feature for that called Change Data Capture. You still will need to write code to access the previous revisions later (CDC creates specific views for that), but at least you don't have to change the schema of your tables, nor implement the change tracking itself. Under the hood, what happens is ...


4

Solve the problem "philosophically" and in code first. And then "negotiate" with code and database to make it happen. As as example, if you're dealing with generic articles, an initial concept for an article might look like this: class Article { public Int32 Id; public String Body; } And at the next most basic level, I want to keep a list of ...


3

The approach that I follow is based on the following premises: Developers are not to be bothered with production data. That's for the operations department to worry about. Configuration xml files, scripts, etc must be kept at a minimum. Everything must be in the source code repository. The source code repository is to contain only diff-able text files, ...


3

I propose looking into in code migrations for your language or technology. I have .NET stack and I can use Entity Framework Migrations where every schema change is single migration that can be automatically applied to database when needed. What is also possible is downgrading database, so pattern for db migration is that you have method for Up() and Down() ...


2

There's a PostgreSQL wiki page for an audit tracking trigger which walks you through how to set up an audit log that will do what you need. It tracks the full original data of a change, as well as the list of new values for updates (for inserts and deletes, there's only one value). If you want to restore an old version, you can grab the copy of the original ...


1

Fogbugz + KilnHg have unlimited private repos in Git / Hg (Actually both at the same time) for free for 1-2 users. It also has good integration into Trello. You can organize repos under projects in it. https://www.fogcreek.com/kiln/try/?fccmp=_startup



Only top voted, non community-wiki answers of a minimum length are eligible