Skip to content

Sequelize: problem with auto-generated fields #15

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

Closed
ShootingStar91 opened this issue Apr 10, 2024 · 3 comments
Closed

Sequelize: problem with auto-generated fields #15

ShootingStar91 opened this issue Apr 10, 2024 · 3 comments
Assignees
Labels
backend Server-side issues

Comments

@ShootingStar91
Copy link
Contributor

ShootingStar91 commented Apr 10, 2024

The automatically generated files have a problem:

(sequelize) Warning: Model "com_users" is declaring public class fields for attribute(s): "user_id", "user_name", "password", "last_login", "now_user_group", "mor_user_group", "gen_user_group".

These class fields are shadowing Sequelize's attribute getters & setters.

See https://sequelize.org/main/manual/model-basics.html#caveat-with-public-class-fields

Possible solutions:

@ShootingStar91 ShootingStar91 added the backend Server-side issues label Apr 10, 2024
@ShootingStar91 ShootingStar91 self-assigned this Apr 10, 2024
@ShootingStar91
Copy link
Contributor Author

Fixed it using the PR mentioned above. Though I didn't use the messy fork directly but copied the relevant file auto-generator.ts as well as removed unused variants from type Dialect. Seemed to work.

@ShootingStar91
Copy link
Contributor Author

Doesnt create and export the correct types...

@ShootingStar91
Copy link
Contributor Author

fixed it by using a custom fork https://github.com/ShootingStar91/sequelize-auto-fixed

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

No branches or pull requests

1 participant