Monday 30 January 2017

Sequelize migration/model CLI workflow question.

There isn't a ton of information in the docs on the use of the CLI with regards to migrations. From what I can gather, it goes something like this:Use the CLI to automatically make as fleshed out a migration as possible. And as flashed out as possible seems to be essentially just the column names. I haven't found a way to add more properties to the columns, such as default values or associations, from the CLI.Get a timestamped migration and a model which includes a partial database schematic pertaining to that tables columns and associations.Go in and redundantly add all the properties you need, such as associations, default values, allowNulls ect..., to both the model and the migration.Because of step 3 I think I've got this wrong. There is so much redundant code there. I think about how Rails does this by the migrations automatically generating the corresponding schema and I think that this has got to be sort of similar in its best flow. But I'm super green and not exactly sure how it works. Thanks!

Submitted January 30, 2017 at 11:20PM by coderbee

No comments:

Post a Comment