chore(local): simplify 'sg db' inline help (#63344)

Follow-up to https://github.com/sourcegraph/sourcegraph/pull/63320 as I
noticed that the `UsageText` didn't include `sg db default-site-admin`.
Additionally, it was quite verbose without providing much info, so I
just dropped it in favour of highlighting notable commands.
This commit is contained in:
Jean-Hadrien Chabran 2024-06-19 16:56:13 +02:00 committed by GitHub
parent e617ca4c76
commit b3b7936ffa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,29 +48,15 @@ var (
dbCommand = &cli.Command{
Name: "db",
Usage: "Interact with local Sourcegraph databases for development",
UsageText: `
# Delete test databases
sg db delete-test-dbs
Usage: "Interact with local Sourcegraph databases for development purposes",
UsageText: `# Create the the default site-admin user with a default token, i.e. it's always going to be
# username: sourcegraph, pw: sourcegraph, token spg_local_f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0
sg db default-site-admin
# Reset the Sourcegraph 'frontend' database
# Reset the database entirely
sg db reset-pg
# Reset the 'frontend' and 'codeintel' databases
sg db reset-pg -db=frontend,codeintel
# Reset all databases ('frontend', 'codeintel', 'codeinsights')
sg db reset-pg -db=all
# Reset the redis database
sg db reset-redis
# Create a site-admin user whose email and password are foo@sourcegraph.com and sourcegraph.
sg db add-user -username=foo
# Create an access token for the user created above.
sg db add-access-token -username=foo
`,
# ... (see below)`,
Category: category.Dev,
Subcommands: []*cli.Command{
{