Skip to content
Draft
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
14 changes: 14 additions & 0 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type DatabasesService interface {
DatabaseEnableFeature(ctx context.Context, app, addonID, feature string) (DatabaseEnableFeatureResponse, error)
DatabaseDisableFeature(ctx context.Context, app, addonID, feature string) (DatabaseDisableFeatureResponse, error)
DatabaseUpdatePeriodicBackupsConfig(ctx context.Context, app, addonID string, params DatabaseUpdatePeriodicBackupsConfigParams) (Database, error)
DatabaseUpgrade(ctx context.Context, app, addonID string) error
}

// DatabaseStatus is a string representing the status of a database deployment
Expand Down Expand Up @@ -229,3 +230,16 @@ func (c *Client) DatabaseDisableFeature(ctx context.Context, app, addonID, featu

return res, nil
}

// DatabaseUpgrade queries the database version upgrade
func (c *Client) DatabaseUpgrade(ctx context.Context, app, addonID string) error {
err := c.DBAPI(app, addonID).DoRequest(ctx, &httpclient.APIRequest{
Method: "POST",
Endpoint: "/databases/" + addonID + "/upgrade",
Expected: httpclient.Statuses{http.StatusOK},
}, nil)
if err != nil {
return errgo.Notef(err, "fail to query the database upgrade")
}
return nil
}
2 changes: 1 addition & 1 deletion mocks_sig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"github.com/Scalingo/go-scalingo.ContainerSizesService": "e2 db 25 a1 01 52 dc e9 6f 7b f4 59 68 95 86 b9 5e 39 8a 61",
"github.com/Scalingo/go-scalingo.ContainersService": "ef 14 ae 81 c9 b4 6a 13 48 e8 bf 44 7d b5 b2 a6 4d e5 02 11",
"github.com/Scalingo/go-scalingo.CronTasksService": "9b d9 a3 ca 9f 9a f7 73 cb b1 aa 80 df 90 21 ff 14 92 b4 4d",
"github.com/Scalingo/go-scalingo.DatabasesService": "bf 4d 92 13 a5 11 a5 f6 ad 14 f3 72 81 19 5a 48 65 1e b1 90",
"github.com/Scalingo/go-scalingo.DatabasesService": "9e 31 e4 5d a4 eb d9 7d 49 88 57 04 ce 00 ba d4 74 bd 70 58",
"github.com/Scalingo/go-scalingo.DeploymentsService": "aa b5 25 87 ff f0 d2 9f 3a 32 42 2d d6 02 33 5f 63 14 2b 9a",
"github.com/Scalingo/go-scalingo.DomainsService": "2f 49 a8 58 f3 ae 8c 4d 4d 6b 1f 47 fc dc db b3 d0 84 ba de",
"github.com/Scalingo/go-scalingo.EventsService": "29 cf 29 33 fb 33 ce 86 3b 49 db ae 25 2d 5d 22 d6 60 21 95",
Expand Down
14 changes: 14 additions & 0 deletions scalingomock/api_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions scalingomock/databasesservice_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.