You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am porting my models from normal sequelize to sequelize-typescript. I am trying to define a column on my model and give it a type of INTEGER(N).UNSIGNED to match what is in my mysql database. Some examples of my code are(names of models redacted):
@Table({modelName: 'modelName', tableName: 'modelNames'})
export class ModelName extends Model<ModelName> {
@PrimaryKey
@AutoIncrement
@Column(DataType.INTEGER.UNSIGNED)
id: number
@Column(DataType.INTEGER(2).UNSIGNED)
buildMajor: number
@Column(DataType.INTEGER(3).UNSIGNED)
buildMinor: number
Versions
sequelize: 5.22.5
sequelize-typescript: 1.1.0
typescript: 3.7.3
Issue type
bug report
feature request
Actual behavior
On doing this both when trying to build for release, and in the VsCode intelisense i get an error such as
src/models/ModelNameHere.ts:71:28 - error TS2769: No overload matches this call.
Overload 1 of 2, '(options?: NumberDataTypeOptions): IntegerDataType', gave the following error.
Type '3' has no properties in common with type 'NumberDataTypeOptions'.
Overload 2 of 2, '(options?: NumberDataTypeOptions): NumberDataType', gave the following error.
Type '3' has no properties in common with type 'NumberDataTypeOptions'.
71 @Column(DataType.INTEGER(3).UNSIGNED)
Expected behavior
According to documentation You should be able to define a length of the integer via (N) because sequelize typescript uses the same DataType as sequelize.
Steps to reproduce
Create a model with a table and some columns. Try to make the datatype of a column DataType.INTEGER(2) or DataType.INTEGER(2).UNSIGNED where 2 can be replaced with any number that's allowed for an int length in mysql
The text was updated successfully, but these errors were encountered:
Issue
I am porting my models from normal sequelize to sequelize-typescript. I am trying to define a column on my model and give it a type of INTEGER(N).UNSIGNED to match what is in my mysql database. Some examples of my code are(names of models redacted):
Versions
Issue type
Actual behavior
On doing this both when trying to build for release, and in the VsCode intelisense i get an error such as
Expected behavior
According to documentation You should be able to define a length of the integer via (N) because sequelize typescript uses the same DataType as sequelize.
Steps to reproduce
Create a model with a table and some columns. Try to make the datatype of a column DataType.INTEGER(2) or DataType.INTEGER(2).UNSIGNED where 2 can be replaced with any number that's allowed for an int length in mysql
The text was updated successfully, but these errors were encountered: