Skip to content

Commit 6202e15

Browse files
committed
Rename 'primary' to 'pgsql
1 parent 806985b commit 6202e15

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

cmd/src/snapshot_databases.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ func init() {
1919
Note that these commands are intended for use as reference - you may need to adjust the commands for your deployment.
2020
2121
USAGE
22-
src [-v] snapshot databases [--targets=<docker|k8s|"targets.yaml">] [--run] <pg_dump|docker|kubectl>
22+
src [-v] snapshot databases [--targets=<docker|k8s|"targets.yaml">] [--run] <pg_dump|docker|kubectl>
2323
2424
TARGETS FILES
2525
Predefined targets are available based on default Sourcegraph configurations ('docker', 'k8s').
2626
Custom targets configuration can be provided in YAML format with '--targets=target.yaml', e.g.
2727
28-
primary:
28+
pgsql:
2929
target: ... # the DSN of the database deployment, e.g. in docker, the name of the database container
3030
dbname: ... # name of database
3131
username: ... # username for database access
@@ -109,7 +109,7 @@ TARGETS FILES
109109
// predefinedDatabaseDumpTargets is based on default Sourcegraph configurations.
110110
var predefinedDatabaseDumpTargets = map[string]pgdump.Targets{
111111
"local": {
112-
Primary: pgdump.Target{
112+
Pgsql: pgdump.Target{
113113
DBName: "sg",
114114
Username: "sg",
115115
Password: "sg",
@@ -126,7 +126,7 @@ var predefinedDatabaseDumpTargets = map[string]pgdump.Targets{
126126
},
127127
},
128128
"docker": { // based on deploy-sourcegraph-managed
129-
Primary: pgdump.Target{
129+
Pgsql: pgdump.Target{
130130
Target: "pgsql",
131131
DBName: "sg",
132132
Username: "sg",
@@ -146,7 +146,7 @@ var predefinedDatabaseDumpTargets = map[string]pgdump.Targets{
146146
},
147147
},
148148
"k8s": { // based on deploy-sourcegraph-helm
149-
Primary: pgdump.Target{
149+
Pgsql: pgdump.Target{
150150
Target: "statefulset/pgsql",
151151
DBName: "sg",
152152
Username: "sg",

cmd/src/snapshot_restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TARGETS FILES
2525
Predefined targets are available based on default Sourcegraph configurations ('docker', 'k8s').
2626
Custom targets configuration can be provided in YAML format with '--targets=target.yaml', e.g.
2727
28-
primary:
28+
pgsql:
2929
target: ... # the DSN of the database deployment, e.g. in docker, the name of the database container
3030
dbname: ... # name of database
3131
username: ... # username for database access

internal/pgdump/pgdump.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
// Targets represents configuration for each of Sourcegraph's databases.
1111
type Targets struct {
12-
Primary Target `yaml:"primary"`
12+
Pgsql Target `yaml:"pgsql"`
1313
CodeIntel Target `yaml:"codeintel"`
1414
CodeInsights Target `yaml:"codeinsights"`
1515
}
@@ -59,8 +59,8 @@ type Output struct {
5959
// path. It can be provided a zero-value Targets to just generate the output paths.
6060
func Outputs(dir string, targets Targets) []Output {
6161
return []Output{{
62-
Output: filepath.Join(dir, "primary.sql"),
63-
Target: targets.Primary,
62+
Output: filepath.Join(dir, "pgsql.sql"),
63+
Target: targets.Pgsql,
6464
}, {
6565
Output: filepath.Join(dir, "codeintel.sql"),
6666
Target: targets.CodeIntel,

0 commit comments

Comments
 (0)