Skip to content

Duplicate Foreign Key Constraint Name #346

Description

@lrojas94

So, I've created two tables which reference the same one (say, address and a user has an address and company too). This makes me run into this problem:

Constraint created by sequelize: addressId_foreign_idx

Results: Both tables will try to use the same constraint name, which, as you might expect, results in:

code: 'ER_DUP_KEY',
errno: 1022,
sqlState: '23000',

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions