Skip to content

Commit 9ffa566

Browse files
authored
Merge pull request #94 from planetscale/backup-restore
Support restoring a backup to a new branch
2 parents 257d253 + c2c3473 commit 9ffa566

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

Diff for: planetscale/backups.go

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
)
1111

1212
type Backup struct {
13+
PublicID string `json:"id"`
1314
Name string `json:"name"`
1415
State string `json:"state"`
1516
Size int64 `json:"size"`

Diff for: planetscale/backups_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func TestBackups_Create(t *testing.T) {
3737
})
3838

3939
want := &Backup{
40+
PublicID: "planetscale-go-test-backup",
4041
Name: testBackup,
4142
CreatedAt: time.Date(2021, time.January, 14, 10, 19, 23, 000, time.UTC),
4243
UpdatedAt: time.Date(2021, time.January, 14, 10, 19, 23, 000, time.UTC),
@@ -71,6 +72,7 @@ func TestBackups_List(t *testing.T) {
7172
})
7273

7374
want := []*Backup{{
75+
PublicID: "planetscale-go-test-backup",
7476
Name: testBackup,
7577
CreatedAt: time.Date(2021, time.January, 14, 10, 19, 23, 000, time.UTC),
7678
UpdatedAt: time.Date(2021, time.January, 14, 10, 19, 23, 000, time.UTC),
@@ -134,6 +136,7 @@ func TestBackups_Get(t *testing.T) {
134136
})
135137

136138
want := &Backup{
139+
PublicID: "planetscale-go-test-backup",
137140
Name: testBackup,
138141
CreatedAt: time.Date(2021, time.January, 14, 10, 19, 23, 000, time.UTC),
139142
UpdatedAt: time.Date(2021, time.January, 14, 10, 19, 23, 000, time.UTC),

Diff for: planetscale/branches.go

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ type CreateDatabaseBranchRequest struct {
3333
Region string `json:"region,omitempty"`
3434
Name string `json:"name"`
3535
ParentBranch string `json:"parent_branch"`
36+
BackupID string `json:"backup_id,omitempty"`
3637
}
3738

3839
// ListDatabaseBranchesRequest encapsulates the request for listing the branches

0 commit comments

Comments
 (0)