Skip to content

Commit

Permalink
adding the replica id to the database replica model (digitalocean#549)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Moore <rmoore@digitialocean.com>
  • Loading branch information
rpmoore and Ryan Moore authored Sep 7, 2022
1 parent b2c0f33 commit dca9844
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ type DatabaseDB struct {

// DatabaseReplica represents a read-only replica of a particular database
type DatabaseReplica struct {
ID string `json:"id"`
Name string `json:"name"`
Connection *DatabaseConnection `json:"connection"`
PrivateConnection *DatabaseConnection `json:"private_connection,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ func TestDatabases_GetReplica(t *testing.T) {
createdAt := time.Date(2019, 01, 01, 0, 0, 0, 0, time.UTC)

want := &DatabaseReplica{
ID: "326f188b-5dd1-45fc-9584-62ad553107cd",
Name: "pool",
Region: "nyc1",
Status: "online",
Expand Down Expand Up @@ -1097,6 +1098,7 @@ func TestDatabases_GetReplica(t *testing.T) {
body := `
{
"replica": {
"id": "326f188b-5dd1-45fc-9584-62ad553107cd",
"name": "pool",
"region": "nyc1",
"status": "online",
Expand Down

0 comments on commit dca9844

Please sign in to comment.