Skip to content

Commit

Permalink
Describe contract
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Aug 21, 2023
1 parent 15fa920 commit 0df272e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/internal/database/postgres/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ const (
oldPostgresBindir = "/usr/local/bin/pg-old"
)

// Upgrade indicates whether the database files are from a previous version of and need to be upgraded
// Upgrade indicates whether the database files are from a previous version of and need to be upgraded.
// If any preconditions are not met, no error is returned, a info log entry is created with the reason.
// Once the upgrade was made, any error condition will require to recover the database from backup.
func (db *Postgres) Upgrade() error {
start := time.Now()
// First check if there are data already present
Expand Down Expand Up @@ -141,12 +143,6 @@ func (db *Postgres) Upgrade() error {
return fmt.Errorf("unable to detect bindir of actual postgres %w", err)
}

// pg_upgrade \
// --old-datadir /data/postgres \
// --new-datadir /data/postgres-new \
// --old-bindir /usr/local/bin/pg-old \
// --new-bindir /usr/local/bin \
// --link
pgUpgradeArgs := []string{
"--old-datadir", db.datadir,
"--new-datadir", newDataDirTemp,
Expand Down

0 comments on commit 0df272e

Please sign in to comment.