3

Issue:

In order to start in a clean environment for developing stuff for a web app I would appreciate to be able to duplicate (clone) an existing DB structure into both a sequelize model + migation files and then seed this with dumb data.

I have found the tool named sequelize-auto which seems to work fine to generate a model file from an exsting DB (beware of not already having for example a users.js model ; it will be overwritten !) : https://github.com/sequelize/sequelize-auto.

This tool will create a model file, but not a migration file.

Question:

Is there a way to build a "state-0" migration file from this model?
For one or two tables it could be fine to set them up by hand, but with a larger amount of tables, it may be error prone and time consuming, that's why I'm searching for an automated way.

swiss_knight
  • 5,787
  • 8
  • 50
  • 92

0 Answers0