sequelize / sequelize-auto

Automatically generate bare sequelize models from your database.
2.9k stars 527 forks source link

useDefine is not working #573

Closed vishnup95 closed 2 years ago

vishnup95 commented 2 years ago

Hey, first off thanks for the super cool package. Saves a lot of time. I am trying to generate models using the below cli command for my local db

sequelize-auto -o "./models" -l esm -d [db_name] -h localhost --caseModel c --caseProp c -u root -p 3306 -x [password] -e mysql --useDefine

The config options I get after running this (the next log in the terminal)

 {
  spaces: true,
  indentation: 2,
  directory: './models',
  additional: {},
  dialect: 'mysql',
  port: 3306,
  host: 'localhost',
  database: '***',
  storage: '****',
  tables: null,
  skipTables: null,
  skipFields: null,
  pkSuffixes: null,
  schema: undefined,
  lang: 'esm',
  caseModel: 'c',
  caseFile: 'o',
  caseProp: 'c',
  noAlias: false,
  noInitModels: false,
  noWrite: false,
  views: false,
  singularize: false,
  username: 'root'
}

All my models are still generated using static. I checked the version and I am running v0.85.0. Am I missing something?

steveschmitt commented 2 years ago

I'm missing something - I haven't released the version that has useDefine in it yet!

It's in the repo, and in the README, but not in npm yet.

vishnup95 commented 2 years ago

That's weird. Do you think we could have a new release with useDefine included then. What are you missing? Would be a nice addition.

steveschmitt commented 2 years ago

Well, I was going to try to pack in some other features and fixes for the next release, but haven't had time.

I'll create a release now with that feature.

steveschmitt commented 2 years ago

The useDefine option is in release 0.8.6, just pushed to npm.

And you get to be the first to use it.

vishnup95 commented 2 years ago

Thanks for the quick turn around and responses. Closing this!