jdavisclark / mite

schema migrations so easy you already know how to write them. guaranteed.
http://jdc0589.github.io/mite
11 stars 6 forks source link

Add ability to create the mite.config file from the cli #15

Closed zmckinnon closed 10 years ago

zmckinnon commented 10 years ago

It would be nice to be able to create the mite.config file from the cli, much like 'npm init' works. It would ask questions and create the file:

mite init

dialect(mysql)?
host(localhost)?
database? test
user? user
password? passwordd
port(3306)?
{
  "database": "test",
  "host": "localhost",
  "user": "user",
  "password": "password",
   "dialect": "mysql",
   "port": 3306
}
Are you sure you want to create this(yes)?

Edit: added in v0.0.10

TASKS: [x] add wizard [x] support default values [ ] config confirmation [ ] attempt to create the db if it doesn't exist

jdavisclark commented 10 years ago

Additionally, the original version of mite would dump the schema and create an initial migration for you from the existing database if you asked it to. Might be nice to add that option as well.

jdavisclark commented 10 years ago

@zmckinnon added by @dhjohn0 in v0.0.10. if you run mite init outside of a mite project it launches the wizard.

right now it creates the config file, but will not try to create the database for you. It also allows invalid user input and doesn't require you to enter anything for properties without a default, so you could potentially generate an invalid config at the moment. Fixes for both will be added at some point.