Skip to content

HCK-18408: comment out the foreign key of a deactivated relationship - #89

Merged
chulanovskyi-bs merged 2 commits into
developfrom
fix/HCK-18408
Nov 3, 2026
Merged

chulanovskyi-bs merged 2 commits into
developfrom
fix/HCK-18408

Conversation

@Sylvie-P

@Sylvie-P Sylvie-P commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
Sub-bugHCK-18408 [AMEX] FE still generates the foreign key of a deactivated relationship

## Content

Jira: HCK-18408

When a relationship is deactivated but both tables and their key columns are activated, forward-engineering still generated the foreign key as an active statement. It should be commented out, like other deactivated objects.

Technical details

  • Studio passes the relationship flag to the DDL provider as isActivated, but createForeignKeyConstraint only looked at the tables and the key columns.
  • The returned isActivated now also takes the relationship flag, the same way the PostgreSQL plugin does it. The columns list is still built like before.
  • !== false is used so a missing flag (old models) keeps the foreign key activated.
  • Redshift has only createForeignKeyConstraint, there is no createForeignKey here.
  • getTableConstraints added every foreign key to the CREATE TABLE without checking isActivated. Deactivated foreign keys are now put in a commented block after the active constraints, like deactivated columns.
  • Tested in Studio on Redshift.
  • Same fix is done in SQLServer, Oracle, MySQL, MariaDB, Db2, Db2-zOS and Redshift.

Made with Cursor

Sylvie-P and others added 2 commits November 3, 2026 12:37
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@chulanovskyi-bs
chulanovskyi-bs merged commit c204c3a into develop Nov 3, 2026
6 of 7 checks passed
@chulanovskyi-bs
chulanovskyi-bs deleted the fix/HCK-18408 branch November 3, 2026 13:26
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