Skip to content

error when using indexes #9

@keenahn

Description

@keenahn
const Foo = Temporal(sequelize.define('foo', {
  amount: {
    type: Sequelize.INTEGER,
    validate: { min: 0 },
    allowNull: false
  },
}, {
  indexes: [
    { fields: [ 'amount' ] },
  ],
}), sequelize)

This causes an error in postgres as it will say
Unhandled rejection SequelizeDatabaseError: relation "foo_amount" already exists

since it will try to create an index of the same name on the fooHistories table

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions