Skip to content
New issue

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

Getting an error when trying to use MySQL POINT type #1715

Closed
1 of 2 tasks
dlandtaa opened this issue Mar 22, 2024 · 1 comment
Closed
1 of 2 tasks

Getting an error when trying to use MySQL POINT type #1715

dlandtaa opened this issue Mar 22, 2024 · 1 comment

Comments

@dlandtaa
Copy link

dlandtaa commented Mar 22, 2024

Issue

I am trying to create a model with a field of type MySQL POINT like this:

@Table({ tableName: 'my_table', timestamps: false })
class MyTableModel extends Model {
    @Column({ field: 'lat_lon', type: DataType.GEOMETRY('POINT') })
    latLon: any;
}

I'm getting an error:

Error: Specified type of property 'latLon'
            cannot be automatically resolved to a sequelize data type. Please
            define the data type manually
    at getSequelizeTypeByDesignType (/my/code/node_modules/sequelize-typescript/dist/model/shared/model-service.js:64:11)
    at annotate (/my/code/node_modules/sequelize-typescript/dist/model/column/column.js:32:77)
    at /my/code/node_modules/sequelize-typescript/dist/model/column/column.js:18:9
    at DecorateProperty (/my/code/node_modules/reflect-metadata/Reflect.js:561:33)
    at Reflect.decorate (/my/code/node_modules/reflect-metadata/Reflect.js:136:24)
    at __decorate (/my/code/dist/src/data/model/MyModel.model.js:4:92)
    at Object.<anonymous> (/my/code/dist/src/data/model/MyModel.model.js:76:1)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)

Versions

  • sequelize: 6.36.0
  • sequelize-typescript: 2.1.6
  • typescript: 5.3.3

Issue type

  • bug report
  • feature request

Actual behavior

Getting the error above

Expected behavior

Should allow me to create the column

@dlandtaa
Copy link
Author

dlandtaa commented Mar 22, 2024

Never mind, stupid mistake on my part. The above works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant