Skip to content

HCK-17916 : rename tables in the PostgreSQL alter script - #203

Open
Sylvie-P wants to merge 1 commit into
developfrom
feat/alter-script-rename-table
Open

Sylvie-P wants to merge 1 commit into
developfrom
feat/alter-script-rename-table

Conversation

@Sylvie-P

@Sylvie-P Sylvie-P commented Sep 28, 2026 •

Copy link
Copy Markdown

https://hackolade.atlassian.net/browse/HCK-17916

Content

A renamed table stays in the delta model. The alter script now emits the rename before the other statements for that table:

ALTER TABLE IF EXISTS schema.old_name RENAME TO new_name;

The name is the technical name when one is set, otherwise the business name. The old name is schema-qualified. The new name is not. A deactivated table or schema leaves the statement commented.

Technical details

  • renameTable template in forward_engineering/ddlProvider/templates.js
  • entityHelpers/nameHelper.js builds the statement from the delta (code, otherwise collectionName, and keyspaceName)
  • getModifyCollectionScriptDtos calls it first

The Studio feature test for this case will be added after the plugin is available in the test image.

Made with Cursor

The delta model already records a table rename. Emit ALTER TABLE ... RENAME TO before the other changes on that table, using the same name the rest of the script uses.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

@Sylvie-P Sylvie-P changed the title feat: rename tables in the PostgreSQL alter script HCK-17916 : rename tables in the PostgreSQL alter script Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants