Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow stub templates #90

Open
pbrink231 opened this issue Jul 31, 2024 · 1 comment
Open

allow stub templates #90

pbrink231 opened this issue Jul 31, 2024 · 1 comment
Labels
enhancement New feature or request migrate Migrate module related seed Seed module related

Comments

@pbrink231
Copy link

I have seen in other migration cli's the use of stubs which are really nice.

I am thinking a command like
npx kysely migrate:stub {stub_name} {migration_name}

Would need to add a stubsFolder option under migrations option in the config file

Then I could have a folder called whatever I want with file names like: my_stub_file.stub. This file would be just like your template file in your src->templates folder.

When the migration is created it will use the stub file as the template, name the file as it does now and use the correct extension.

@igalklebanov igalklebanov added enhancement New feature or request migrate Migrate module related labels Jul 31, 2024
@igalklebanov
Copy link
Member

igalklebanov commented Aug 2, 2024

Hey 👋

Thank you for raising this! 🙏

Looking at knex/knex#3316, knex's stub feature works a bit differently.
A --stub flag on migrate:make and seed:make that can accept a filename (looks for it in the migrations/seeds folder) or a path relative to the config file. There is no stubs folder.

This is a welcome enhancement, and gets us closer to 100% knex CLI coverage.

@igalklebanov igalklebanov added the seed Seed module related label Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request migrate Migrate module related seed Seed module related
Projects
None yet
Development

No branches or pull requests

2 participants