Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

shiwano
Copy link
Contributor

@shiwano shiwano commented May 17, 2020

Hi,

This #360 change caused that the y/n prompt will appears when dropping the database, it has made inoperable our database drop job of kubernetes.
I think that the drop command should have -y option for CI/CD operations (Of course, we can also use the yes command, but it is so painful).

@coveralls
Copy link

coveralls commented May 17, 2020

Pull Request Test Coverage Report for Build 767

  • 0 of 18 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 53.361%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/cli/main.go 0 18 0.0%
Totals Coverage Status
Change from base Build 764: -0.09%
Covered Lines: 2612
Relevant Lines: 4895

💛 - Coveralls

@coveralls
Copy link

Pull Request Test Coverage Report for Build 765

  • 0 of 18 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 53.361%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/cli/main.go 0 18 0.0%
Totals Coverage Status
Change from base Build 764: -0.09%
Covered Lines: 2612
Relevant Lines: 4895

💛 - Coveralls

} else {
log.fatal("Aborted dropping the entire database schema")
dropFlagSet := flag.NewFlagSet("drop", flag.ExitOnError)
responseYes := dropFlagSet.Bool("y", false, "Drop the entire database schema")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about using -y. Most other CLIs use -f for this behavior.

The flag help text should be more descriptive.
If we use -f, something like Force the drop command by bypassing the confirmation prompt might work.
Any ideas for a short descriptive help text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your confirmation!

You are certainly right.
I'm sure the help text you wrote is fine too.

I’ve added commits for fix. Could you check it? 🙏

@shiwano shiwano changed the title Add -y option to drop command Add -f option to drop command May 18, 2020
@dhui dhui merged commit 524edc9 into golang-migrate:master May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants