Skip to content

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

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 and createForeignKey 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.
  • Foreign keys generated as separate statements (alter-script helpers) did not receive the relationship flag. They now get it from compMod.isActivated.new, so the ALTER TABLE ... ADD CONSTRAINT is commented out too.
  • Tested in Studio with inline and separate foreign keys.
  • 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>
…n key statements

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

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

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