Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add db:create and db:drop tasks #70

Closed
cesarandreu opened this issue Dec 8, 2014 · 25 comments
Closed

Add db:create and db:drop tasks #70

cesarandreu opened this issue Dec 8, 2014 · 25 comments
Labels

Comments

@cesarandreu
Copy link

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.

@sdepold
Copy link
Member

sdepold commented Dec 8, 2014

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

@cesarandreu
Copy link
Author

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

@anthonator
Copy link

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

@sdepold
Copy link
Member

sdepold commented Dec 27, 2014

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

@sladebot
Copy link

+1

@sdepold
Copy link
Member

sdepold commented Feb 11, 2016

PRs are welcome :)

@sadaf2605
Copy link

+1

7 similar comments
@jackycute
Copy link

+1

@derrandz
Copy link

👍

@joaodiogocosta
Copy link

+1

@juniorplenty
Copy link

+1

@joost
Copy link

joost commented Jan 3, 2017

+1

@Catchpowle
Copy link

+1

@anthony-ism
Copy link

+1

@edorgeville
Copy link

@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 ! 😄

@Epyon616
Copy link

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

@elliotsabitov
Copy link

I also think that this feature would be very helpful.

@nicholaswagner
Copy link

nicholaswagner commented Apr 25, 2017

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

@mmahalwy
Copy link

mmahalwy commented May 2, 2017

+1

1 similar comment
@dorothythurston
Copy link

+1

@itsMattShull
Copy link

+1

@sushantdhiman
Copy link
Contributor

sushantdhiman commented Sep 26, 2017

@Kae2312 are you just randomly commenting +1 on issues :), its already available in v3.0

@juliocanares
Copy link

@sushantdhiman I think the command sequelize db:drop must add IF EXISTS;

@itsashis4u
Copy link

sequelize db:create should have support for IF NOT EXISTS as a flag --if-not-exists

@Telokis
Copy link

Telokis commented May 7, 2018

@itsashis4u There is an issue for this problem: #629.

@juliocanares There is an issue for this problem: #599

codetriage-readme-bot pushed a commit to codetriage-readme-bot/cli that referenced this issue Jun 5, 2019
Return an error from askForConfigInfo instead of using panic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests