mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-22 22:11:29 +08:00
When renaming a column on a continuous aggregate, only the user view column was renamed. This commit changes this by applying the rename on the materialized table, the user view, the direct view, and the partial view, as well as the column name in the dimension table. Since this also changes some of the table definitions, we need to perform the same rename in the update scripts as well, which is done by comparing the direct view and the user view to decide what columns that require a rename and then executing that rename on the direct view, partial view, and materialization table, as well as updating the column name in the dimension table. When renaming columns in tables with indexes, the column in the table is renamed but not the column in the index, which keeps the same name. When restoring from a dump, however, the column name of the table is used, which create a diff in the update test. For that reason, we change the update tests to not list index definitions as part of the comparison. The existance of the indexes is still tracked and compared since the indexes for a hypertable is listed as part of the output. If a downgrade does not revert some changes, this will cause a diff in the downgrade test. Since the rename is benign and not easy to revert, this will cause test failure. Instead, we add a file to do extra actions during a clean-rerun to prevent these diffs. In this case, applying the same renames as the update script. Fixes #3405