We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sequelize-typescript overrides the declarated model option indexes with the decorated indexes. This is due to a misbehaviour in
sequelize-typescript/src/sequelize/sequelize/sequelize.ts
Line 98 in 8ded61a
@Table({ indexes: [ { unique: true, fields: ["email"], name: "another_unique_email" } ] }) export class Admin extends Model { /** * User email address. */ @AllowNull(false) @Unique({ name: "unique_email" }) declare public email: string; }
The text was updated successfully, but these errors were encountered:
fix(sequelize#1720): supports indexes with decorator
e4fd103
I've submitted a PR that seems to fix the initial issue, but I've found another issue. indexArray isn't including @unique indexes.
indexArray
@Table({ indexes: [ { unique: true, fields: ["name", "email"], name: "example_composite_unique_index" } ] }) export class Admin extends Model { /** * User full name. */ @Unique("unique_admin_name") @Column(DataType.STRING(256)) declare public name: string; /** * User email address. */ @AllowNull(false) @Index("admin_email") declare public email: string; }
This results in the following indexesArray:
indexesArray
[ { name: 'admin_email', fields: [ [Object] ], type: '', parser: null } ]
Sorry, something went wrong.
Wow, this is actually not closed, I've fixed it internally and just linked this issue internally for us to know about it.
Successfully merging a pull request may close this issue.
Issue
sequelize-typescript overrides the declarated model option indexes with the decorated indexes.
This is due to a misbehaviour in
sequelize-typescript/src/sequelize/sequelize/sequelize.ts
Line 98 in 8ded61a
Versions
Issue type
Related code
The text was updated successfully, but these errors were encountered: