Skip to content


Add more --template-dir options #50

theory opened this Issue · 4 comments

2 participants


First, add a short version of --template-dir to the add command.

But more importantly, add a --template-file option to allow a file to be selected. It should have short options, too.


@rdunklau points out that, if we want to support individual template files, we'll need separate --deploy-template, --revert-template, and --test-template options.


Bit of background: The idea here is to allow users to create templates for various typical tasks, like adding a table or defining a function. These templates could define a lot more boilerplate to start with. It will be even more useful when combined with aliases, as suggested in #89:

sqitch config --user alias.add-table add \
  --deploy-template tmpl/deploy/ \
  --revert-template tmpl/revert/ \
  --verify-template tmpl/refert/

very excited for this feature. thanks.

@theory theory added a commit that referenced this issue
@theory Move templatess to `templates/$action/$engine.tmpl`.
This gives us engine-specific default templates, currently including Postgres
and SQLite templates. The addition of the `--template` option to the `add`
command allows the user to specify a template of any name, which will make
customization much easier.

Still to do:

* Update the docs with the new template names.
* Update the installer to install the templates in the right place.
* Update the installer to move existing templates to subdirectories,
  and emit a message about user- or project-specific custom templates
  needing to be moved, as well.

Ref issue #50.
@theory theory closed this in d3a17d0

So, I did it a bit differently than I originally came up with in this ticket. The description of the changes in d3a17d0 should make it clear(ish) how it works. Please let me know if you experience any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.