Files
onyx/tools/ods/cmd/db.go
T
Jamison Lahmanandgreptile-apps[bot] 18a7bdc292 chore(devtools): ods db operations (#6661)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-12-06 09:53:25 -08:00

29 lines
774 B
Go

package cmd
import (
"github.com/spf13/cobra"
)
// NewDBCommand creates the parent db command.
func NewDBCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "db",
Short: "Database administration commands",
Long: `Database administration commands for managing PostgreSQL and Alembic migrations.
Commands include dropping/recreating databases, creating and restoring snapshots,
and managing Alembic migrations (upgrade, downgrade, current, history).`,
}
// Add subcommands
cmd.AddCommand(NewDBDropCommand())
cmd.AddCommand(NewDBDumpCommand())
cmd.AddCommand(NewDBRestoreCommand())
cmd.AddCommand(NewDBUpgradeCommand())
cmd.AddCommand(NewDBDowngradeCommand())
cmd.AddCommand(NewDBCurrentCommand())
cmd.AddCommand(NewDBHistoryCommand())
return cmd
}