How would we go about rollbacks for specific data changes in our SQL changelogs.
For updates its simple, for inserts also (at least when you know the unique key )…
But what about TRUNCATE for instance? What would the – rollback comment be in this case?
If you are truncating a table I would highly recommend making a backup table that contains the data before truncating. Then if you need to rollback the truncate you can restore the data from the backup table. In a future execution, after validation, you can drop the backup table.