Skip to content

Add a 'new' command #23

Open
Open
@jamlen

Description

@jamlen

Just wondered if others would find this useful...

I'd like to see a new command so when using the command line I can do

sql-migrate new udf-ParseDate

and it create a templated file in the ./migration folder (or what ever this is set in the config) named <current epoch>-<name>.sql, eg: 1443610373-udf-ParseDate.sql

The templating would have the -- +migrate Up and -- +migrate Down defined.

An enhancement to this would be to take the name and scan for the last migration matching the name and populate the migrate Down section of the template from the last migrate Up script.

Comments appreciated, if people like this I'll look at PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions