Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmd/src/snapshot_databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ func init() {
Note that these commands are intended for use as reference - you may need to adjust the commands for your deployment.

USAGE
src [-v] snapshot databases [--targets=<docker|k8s|"targets.yaml">] [--run] <pg_dump|docker|kubectl>
src [-v] snapshot databases [--targets=<docker|k8s|"targets.yaml">] [--run] <pg_dump|docker|kubectl>

TARGETS FILES
Predefined targets are available based on default Sourcegraph configurations ('docker', 'k8s').
Custom targets configuration can be provided in YAML format with '--targets=target.yaml', e.g.

primary:
pgsql:
target: ... # the DSN of the database deployment, e.g. in docker, the name of the database container
dbname: ... # name of database
username: ... # username for database access
Expand Down Expand Up @@ -109,7 +109,7 @@ TARGETS FILES
// predefinedDatabaseDumpTargets is based on default Sourcegraph configurations.
var predefinedDatabaseDumpTargets = map[string]pgdump.Targets{
"local": {
Primary: pgdump.Target{
Pgsql: pgdump.Target{
DBName: "sg",
Username: "sg",
Password: "sg",
Expand All @@ -126,7 +126,7 @@ var predefinedDatabaseDumpTargets = map[string]pgdump.Targets{
},
},
"docker": { // based on deploy-sourcegraph-managed
Primary: pgdump.Target{
Pgsql: pgdump.Target{
Target: "pgsql",
DBName: "sg",
Username: "sg",
Expand All @@ -146,7 +146,7 @@ var predefinedDatabaseDumpTargets = map[string]pgdump.Targets{
},
},
"k8s": { // based on deploy-sourcegraph-helm
Primary: pgdump.Target{
Pgsql: pgdump.Target{
Target: "statefulset/pgsql",
DBName: "sg",
Username: "sg",
Expand Down
2 changes: 1 addition & 1 deletion cmd/src/snapshot_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TARGETS FILES
Predefined targets are available based on default Sourcegraph configurations ('docker', 'k8s').
Custom targets configuration can be provided in YAML format with '--targets=target.yaml', e.g.

primary:
pgsql:
target: ... # the DSN of the database deployment, e.g. in docker, the name of the database container
dbname: ... # name of database
username: ... # username for database access
Expand Down
6 changes: 3 additions & 3 deletions internal/pgdump/pgdump.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

// Targets represents configuration for each of Sourcegraph's databases.
type Targets struct {
Primary Target `yaml:"primary"`
Pgsql Target `yaml:"pgsql"`
CodeIntel Target `yaml:"codeintel"`
CodeInsights Target `yaml:"codeinsights"`
}
Expand Down Expand Up @@ -59,8 +59,8 @@ type Output struct {
// path. It can be provided a zero-value Targets to just generate the output paths.
func Outputs(dir string, targets Targets) []Output {
return []Output{{
Output: filepath.Join(dir, "primary.sql"),
Target: targets.Primary,
Output: filepath.Join(dir, "pgsql.sql"),
Target: targets.Pgsql,
Comment on lines +62 to +63
Copy link
Member

Choose a reason for hiding this comment

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

It's been a long time since I've been here, but are there any other process docs we need to update that may reference this DB by its old name?

}, {
Output: filepath.Join(dir, "codeintel.sql"),
Target: targets.CodeIntel,
Expand Down
Loading