postgresql-tableversion icon indicating copy to clipboard operation
postgresql-tableversion copied to clipboard

Review the way schema changes are revisioned.

Open billgeo opened this issue 6 years ago • 4 comments

Dropping columns in revisioned data has caused some issues and is not best practice as we lose history. One idea is to not allow dropping columns for revisioned data. This would need to be decided with Property Rights who sometimes drop columns in Landonline and the BDE output.

See discussion at #106

billgeo avatar Apr 23 '18 03:04 billgeo

The other ideas to to allow dropping columns are:

  1. On deleting a column that's the end of the versioned table. A new master table is required and then we version that. Drawback is we don't get the table history in one revision table.

  2. the column never actually gets dropped in the xx_revision table, it only marked as deleted from a given revision. This is what Koordiantes does. Drawback is this solution is more complex to implement and would involve a system table to record the schema at given revisions (maybe just a json definition). Under this solution the ver_get_xx_xx_diff and ver_get_xx_xx_revision functions would need to be updated to return the correct the columns and results (e.g if column is delete then all rows have changed). Also this solution might be a API breaking change as the function signatures the column names and types are hard coded and we might not what that anymore...

palmerj avatar Apr 23 '18 04:04 palmerj

Definitely I prefer more second option.

imincik avatar Apr 23 '18 11:04 imincik

This issue has been automatically marked as stale as there has not been any activity for sometime. The issue will be closed in 14 days if no further activity.

stale[bot] avatar Oct 06 '18 12:10 stale[bot]

Unlikely to fix this.

billgeo avatar Jul 12 '22 02:07 billgeo