'new' should not require dbconfig.yml
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.4k
- Forks
- 292
- PR merge metrics
- No merged PRs in 30d
Description
As far as I can tell the new command only creates a file with the correct format.
For that the -config and -env flags should not be required, since it does not have to speak to the database.
https://github.com/rubenv/sql-migrate/blob/79fe99e24311fa42469fb2ca23eb3f8f065e6155/sql-migrate/command_new.go#L36
I'd suggest removing the requirement to provide these options as they are not relevant for this case.
That would also open up using sql-migrate new <name> locally without requiring the dbconfig.yml
An example use case:
We are using sql-migrate with embedding everything so that we have one less dependency on the server where we want to install the application.
We also don't use yml files for configuration but rather environment variables.
Requiring the dbconfig.yml as the only configuration option for the new subcommand prevents us from using the sql-migrate cli tool locally
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in sql-migrate/command_new.go at the option checks around line 36. Trace the new subcommand's argument handling and verify that sql-migrate new <name> works without -config, -env, or dbconfig.yml while still creating the correctly formatted migration file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100