cli icon indicating copy to clipboard operation
cli copied to clipboard

Add db:create and db:drop tasks

Open cesarandreu opened this issue 11 years ago • 25 comments

I come from a Rails background and think it'd be pretty convenient to have sequelize db:create and sequelize db:drop as part of the cli.

Since I only use Postgres I wrote two scripts to achieve this and published it under sequelize-migration-pg-extras.

If you could give some advice on how to go about adding native support, I'd be willing to try writing a PR.

cesarandreu avatar Dec 08 '14 02:12 cesarandreu

Hi Cesar,

I agree :) In fact I actually created a ticket for that some time ago (as you have already seen). The first step would be a PR for the sequelize core which adds the respective queries (as this is currently not implemented). I'd assume that this is fairly easy, but I'm not entirely sure. Once the core supports something like sequelize.createDatabase and sequelize.dropDatabase we can add the stuff to the CLI. This basically means, it would be necessary to add another key value pair here:

https://github.com/sequelize/cli/blob/master/lib/tasks/db.js#L81

sdepold avatar Dec 08 '14 07:12 sdepold

Oh, I completely forgot about that. I'll take a look, sounds good.

cesarandreu avatar Dec 08 '14 08:12 cesarandreu

Would love this. Does a ticket need to be opened at sequelize proper for adding sequielize.createDatabase and sequelize.dropDatabase?

anthonator avatar Dec 27 '14 10:12 anthonator

Hm, could not harm, though this ticket might be good enough already

sdepold avatar Dec 27 '14 12:12 sdepold

+1

sladebot avatar Feb 10 '16 21:02 sladebot

PRs are welcome :)

sdepold avatar Feb 11 '16 05:02 sdepold

+1

sadaf2605 avatar May 11 '16 12:05 sadaf2605

+1

jackycute avatar Jun 28 '16 02:06 jackycute

:+1:

derrandz avatar Jul 15 '16 11:07 derrandz

+1

joaodiogocosta avatar Aug 01 '16 20:08 joaodiogocosta

+1

juniorplenty avatar Oct 25 '16 00:10 juniorplenty

+1

joost avatar Jan 03 '17 09:01 joost

+1

Catchpowle avatar Jan 05 '17 11:01 Catchpowle

+1

anthony-ism avatar Jan 11 '17 22:01 anthony-ism

@joost @Catchpowle @anthony-ism
Since March 10, 2016, it is possible to use emoji reactions on comments. Please use the 👍 reaction to show your interest instead of commenting "+1". This saves everyone in the thread a notification. If you want to get updates on the issue in the future, you can use the "Subscribe" button. Thank you ! 😄

edorgeville avatar Jan 11 '17 23:01 edorgeville

Has anything been done on adding these? At present this is the only thing(s) stopping me from using sequelize in my companies project.

Epyon616 avatar Mar 21 '17 13:03 Epyon616

I also think that this feature would be very helpful.

elliotsabitov avatar Mar 29 '17 02:03 elliotsabitov

Hahaha.. I also would love to see this feature. 👍

nicholaswagner avatar Apr 25 '17 17:04 nicholaswagner

+1

mmahalwy avatar May 02 '17 17:05 mmahalwy

+1

dorothythurston avatar May 31 '17 20:05 dorothythurston