postgresql-tableversion
postgresql-tableversion copied to clipboard
Review the way schema changes are revisioned.
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
The other ideas to to allow dropping columns are:
-
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.
-
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...
Definitely I prefer more second option.
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.
Unlikely to fix this.