Overview
IntegrationsPricing

blacksmith generate migration

This command generates up and down files for a SQL migration.

Example:

$ blacksmith generate migration \
  --name add_user_id \
  --path ./warehouse/migrations

Generating files:

  -> Generating migration at ./warehouse/migrations
     Success!

Required flags

  • --name [migration]: Set the name of the migration. It shall be an overview of the migration's changes. It shall be a valid name only containing lowercase letters (a-z), underscores (_), and dashes (-).

    Example:

    $ blacksmith generate migration \
      --name add_user_id

Optional flags

  • --path [path]: Relative path where the migration's files will be generated. If the directories don't exist, they will automatically be created (if possible). If files already exist at the path with the same name of the ones generated by the CLI, an error will be prompted. The CLI will never override existing files.

    Aliases: -p [path]

    Example:

    $ blacksmith generate migration \
      --name add_user_id \
      --path ./warehouse/migrations
Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the repository. Once we merge it, the changes will be reflected on the website the next time it is deployed.

Thank you for your contributions!