Skip to main content
2 of 3
added 304 characters in body
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623

Poking holes: what if the database schema is changes at same point later in time, and a column name changes or is deleted completely? Lots of database system allow this.

For data integrity: you must make sure that every update or delete operation will for sure update your tracking table. That is best accomplished by triggers calling a stored procedure. You should make sure only those stored procedure has writing access to your tracking table, so noone else can write wrong values.

If you can live with a db vendor specific solution: most db systems have system tables where the schema information (table names, table ids, column names etc) is stored. You can check if it is possible to set a foreign key reference to such a system table. That would allow to replace the field name by a field ID if the database supports something like this.

Doc Brown
  • 220.3k
  • 35
  • 410
  • 623