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

`mite create` Accept input for filename #45

Open notduncansmith opened 10 years ago

notduncansmith commented 10 years ago

mite create should take an (optional) parameter for the name of the new migration file, and default to the current timestamp name if no name is provided.

The ideal syntax, in my opinion, would be: mite create my_new_migration.

mite create --name my_new_migration feels unnecessarily more verbose.

jdavisclark commented 10 years ago

I have wanted to add some additional out of the box naming schemes for a while. How about we support a "migrationScheme" property in the .mite config. Then, if it's set to "user input" or something, mite create prompts you for a < 20 char description (or also accepts it via an argument), which gets URL style slugified and then generates a file like: 1.add-user-table.sql (the numeric prefix would be automatic).

Thoughts?

notduncansmith commented 10 years ago

Funny story, we're doing exactly that scheme on a current client project :)

I like the idea of config specifying naming scheme. Maybe we could allow Moment-style patterns (or Mustache) using metadata about the migration (sluggified user input, index, and timestamp come to mind).

On Sun, Apr 20, 2014 at 4:25 PM, Davis Clark notifications@github.com wrote:

I have wanted to add some additional out of the box naming schemes for a while. How about we support a "migrationScheme" property in the .mite config. Then, if it's set to "user input" or something, mite create prompts you for a < 20 char description, which gets URL style slugified and then generates a file like: 1.add-user-table.sql (the numeric prefix would be automatic).

Thoughts?

Reply to this email directly or view it on GitHub: https://github.com/jdc0589/mite-node/issues/45#issuecomment-40905324