fabrix-app / spool-sequelize

Spool: Sequelize ORM for Fabrix
Other
7 stars 2 forks source link

feat(): Allow/Support Sequelize CLI migrations #48

Open scott-wyatt opened 5 years ago

scott-wyatt commented 5 years ago

Context:

Migration is one of the most important features for the lifecycle of an application. We should provide top notch support for https://sequelize.org/v5/manual/migrations.html. I don't really have a plan for the best way to do this, but we could use the config.sequelize to set the paths to the migrations and enable the CLI to work with the spool.

jaumard commented 4 years ago

problem with sequelize migration is that it's mostly based on the use of the CLI for creating the models which we don't do in fabric.

Or do you have something else in mind ?

scott-wyatt commented 4 years ago

So, I've been playing with this a little bit with the CLI, and it turns out, you can use a config for the CLI and point it where you want everything to happen. Probably at least need to find a good way of using the CLI and workin inside fabrix. Right now, the when migrate is turned on Fabrix, it's just calling model sync, which works about 65% of the time, and only for the current runtime environment.
I've been thinking about the Fab CLI here and allowing people to extend it just like they would fabrix, so that way any spool could also include it's fab CLI instructions and it would just work :-)

jaumard commented 4 years ago

Is there a list of fab CLI commands ? Didn't even know there was one lool But I like the idea of spool being able to extend it ! I'll try to dig a bit in sequelize migration see if I can understand better how it works ^^

scott-wyatt commented 4 years ago

Awesome! There's this https://github.com/fabrix-app/fab-cli, and it's not fully working yet :-(