Skip to content

Conversation

@taras-dubyk
Copy link
Contributor

@taras-dubyk taras-dubyk commented Nov 6, 2025

Sub-taskHCK-13407 Add primary, unique key constraint script option

Content

Add Script Options (and Alter Script Generation) for Primary Key and Unique Key Constraints

Changes

  • Implemented ALTER script generation for PK/UK constraints in Azure Synapse SQL
  • Added support for composite PRIMARY KEY and UNIQUE constraints (with constraint names)
  • Added support for column-level PRIMARY KEY and UNIQUE constraints (unnamed)
  • Implemented activation/deactivation handling with SQL comment generation

Limitations

  • Column-level (unnamed) constraints can only be added, not dropped via ALTER TABLE (Synapse/SQL Server limitation)

@taras-dubyk taras-dubyk self-assigned this Nov 6, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@chulanovskyi-bs chulanovskyi-bs merged commit 408c3f4 into feat/HCK-13329-script-generation-options Nov 6, 2025
1 check passed
@chulanovskyi-bs chulanovskyi-bs deleted the feature/HCK-13407 branch November 6, 2025 13:48
chulanovskyi-bs added a commit that referenced this pull request Nov 7, 2025
* feat: added script generation options

* chore: untangled dependencies, resolved sonar remarks

* feat: removed invalid script option entries

* feat: added dedicated fe/api

* fix: proper import

* removed unused options

* HCK-13407: add primary, unique constraints handling for the script options (#126)

* add pk, uk script options

* add commenting deactivated pk, uk constraints

* remove drop inline pk, uk constraint

* remove comment

* refactor: reduce duplication

* removed foreign key and check constraints from FE (not supported)

* feat: alter nullable

* HCK-13329: alter default (#127)

---------

Co-authored-by: Taras Dubyk <[email protected]>
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.

3 participants