Skip to content

SQL Schema - Constraint name must include the table name #401

@HidekiCofema

Description

@HidekiCofema

Describe the bug
In Schema SQL, the script creates the unique constraint name as something like "UQ_" + [Column Name].

To Reproduce
Steps to reproduce the behavior:

  1. Create a table, like "product" with columns "id", "code" and "description" and set the "code" column as unique,
  2. Create another table, like "equipment" with columns "id", "code", "description" and set the "code" column as unique.
  3. Click on "Schema SQL" and the script will show two constraint with the same name (UQ_code), that will raise error when executed in SQL Server.

Expected behavior
The constraint names should have the table name to avoid conflicts. Instead of UQ_code, they should be UQ_product_code and UQ_equipment_code.

Screenshots
If applicable, add screenshots to help explain your problem.

Browser (please complete the following information):
Not relevant

VSCode (please complete the following information):

  • OS: Windows 11
  • VSCode version: 1.104.1
  • Extension Version: 2.1.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions