Skip to content

Make binary verbose#612

Merged
sdepold merged 5 commits intosequelize:masterfrom
terraflubb:make_binary_verbose
May 13, 2013
Merged

Make binary verbose#612
sdepold merged 5 commits intosequelize:masterfrom
terraflubb:make_binary_verbose

Conversation

@terraflubb
Copy link
Copy Markdown
Contributor

Addresses #610 , might be a starting point if @leostera feels like going to town on this sometime.

Here are a handful of improvements to make the sequelize binary a bit more verbose (including the migrations).

  • Set the environment via the command line 46f5caf
    • sequelize -m -e test will run in the test environment
  • Upon failing to read the config/config.json output a more useful error. 4c23c8a
    • Instead of throwing an error, catch it and output if it was a parse or file system issue
    • exit with an error code
  • Add done() to migration skeletons 6f65e6d
    • I keep forgetting to do this to the down() so my migrations hang, I can't be alone, and I think it makes sense for it to be part of the skeleton.
  • Output the elapsed time of migrations 61482c0
    • If no migrations are to be run, instead of saying nothing (crickets) it will inform the user that there are no migrations to run.
    • A little bit more information in the migration output, not as pretty as it could be (it would be nice if it stayed all on the same line instead of breaking it into two) but it's not any bigger than the original, and has more information.
  • This one is subjective, but I "improved" the copy in the binary output 37244f1
    • I find the term 'undone migrations' awkward because it sounds like it was done, then undone. The term used in other places for a migration which has yet to be performed is "pending" so I stuck that in there.
    • Some of the errors were a bit prickly, so I tried to change them to refer to other commands

Still defaults to 'development' if NODE_ENV isn't set so backwards compatibility is ensured.
Also replaced one thrown error with a console.log. The rest of the errors were not thrown, and since this file is run from the shell, it will be an edge case that it will ever be caught. It looks messy when it happens. So it now returns an exit code of 1 to indicate things went sideways.
Because I always forget to add one to 'down' and then my migrations don't undo.

Also upgraded a ==.
And quit with a code after outputting it.
@terraflubb terraflubb mentioned this pull request May 11, 2013
@sdepold
Copy link
Copy Markdown
Member

sdepold commented May 13, 2013

sounds good, will check later :)

@sdepold sdepold merged commit 61482c0 into sequelize:master May 13, 2013
@sdepold
Copy link
Copy Markdown
Member

sdepold commented May 13, 2013

thanks a lot :)

@leostera
Copy link
Copy Markdown

👍

So...can I now work on what we discussed at #610 ?

@terraflubb
Copy link
Copy Markdown
Contributor Author

I'd say go for it... it would be helpful I think. I'd like to take a crack at grunt integration, and I think that it would be helpful.

@leostera
Copy link
Copy Markdown

Great, looking forward to the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants