sequelize-cmd icon indicating copy to clipboard operation
sequelize-cmd copied to clipboard

No such file or directory

Open sanderhouttekier opened this issue 11 years ago • 8 comments

Hi,

I just installed sequelize-cmd globally, and after trying it out in the terminal I get the return: No such file or directory

I verified that sqcmd is in my .node/.bin folder linked to the global module in the lib folder. I'm having trouble pinpointing the exact issue. since, other modules like nodemon are also installed globally (next) to sequelize-cmd in the global .bin folder. and they are perfectly accessible.

sander@sander-pc ~/projects/sequelize-cmd-test $ sqcmd init
: No such file or directory
sander@sander-pc ~/projects/sequelize-cmd-test $ sqcmd addModel user firstName lastName
: No such file or directory
sander@sander-pc ~/projects/sequelize-cmd-test $ 

sanderhouttekier avatar Jan 10 '15 02:01 sanderhouttekier

I'll take a look at this tomorrow. and get back to u sit tight.

origin1tech avatar Jan 10 '15 03:01 origin1tech

I was messing around with this since I had nothing better to do tonight, but didn't get much further. Thing is, when I manually edit the source code of your lib/index.js file and just add a console log anything that would generate console output, still doesn't react to that.

all i keep getting is: No such file or directory

So I fear your source could be just fine while It just fails executing.

any other info you need: node version: 0.10.28 sequelize ORM version: 2.0.0.rc7 sequelize cli version: 1.0.4

sanderhouttekier avatar Jan 26 '15 00:01 sanderhouttekier

Deprecated, Sequelize has decided to pull migration from core in favor of Umzug https://github.com/sequelize/umzug

origin1tech avatar Feb 05 '15 22:02 origin1tech

meaning, sequelize in their new version dropped support for their migration system in favor of the new umzug module. though I can see sequelize-cmd still has other assets? like seedings and such. can we keep using these until cmd is updated to the new migration flow? (i understand this last update won't be for the close future, but do you have a timeframe as to when you want to include it? is it something you started on, or is it to be checked out when sequelize v2 is fully released and out of release candidate state?

sanderhouttekier avatar Feb 10 '15 12:02 sanderhouttekier

the prob is deprecating now is far easier than later when its use is further saturated. Concerned about flipping a switch and saying well guys you should be using "x" now instead of "y".

There is without question a need for it. Umzug as near as I can tell (haven't looked that close just yet) doesn't generate migrations based on models, doesn't seed or do templates and so on.

Also kinda blows that this (migrations from core) is getting pulled all of the sudden. When this proj. kicked off just a few months ago Mick himself never mentioned this was in the pipe, a little frustrated by that but doesn't mean there wasn't good reason for pulling it either.

origin1tech avatar Feb 10 '15 16:02 origin1tech

No, you are absolutely right on your assumptions, i've been looking at the umzug library and it not only doesn't generate migrations for create model or any other modification, it is even completely framework agnostic. the umzug migration module is just what it is. a framework agnostic migrations module, that stores its up and down migrated migrations in a json log by default, but could intereact with a sequelize model and store the executed migrations log in a sequel database table if you wish to do so...

any other logic will and needs to go elsewhere, either in the sequelize CLI they have or in a project like yours which builds upon the migration API then. I can only imagine they saw what your module was promissing and should be planning to have that worked into their CLI in the (near) future. But whether they have it actively in their planning, or just as an idea I can't say.

sanderhouttekier avatar Feb 10 '15 17:02 sanderhouttekier

Maybe what could be done is this...

Deprecate sequelize-cmd. I can finish working through the changes in our project (essentially I need to test before I push it up) currently so everyone else can benefit.

Add a clear disclaimer something to the effect that its deprecated and may or may not change to support Umzug in the near future. You've been warned sort of deal.

Again my concern is as I know how it feels on the other end. I don't want to get too many using sqcmd and then suddenly shut it down, its irresponsible.

For record porting over to Umzug's flow I doubt will be very difficult.

origin1tech avatar Feb 10 '15 17:02 origin1tech

Just to mention, i've just tried out sequelize-cli their own CLI. and while I said umzug does not create migrations when you add a new model or make modifications, and that is still correct, their CLI does create migrations to some extend.

using the commands like sequelize model:create --name Task --attributes "title:string, completed:boolean"

a migration was generated for that new task model. however as far as i see this is the only automatic integration with the migration engine umzug.

no commands seem to exist to generate a new migration after you made adjustments or added relations or so. but this is a start already.

sanderhouttekier avatar Feb 11 '15 13:02 sanderhouttekier