Skip to content
Merged
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
7 changes: 7 additions & 0 deletions pkg/spanner/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/hashicorp/go-multierror"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/grpc/codes"
)

const (
Expand Down Expand Up @@ -491,6 +492,12 @@ func (c *Client) EnsureMigrationTable(ctx context.Context, tableName string) err
if err == nil {
return nil
}
if spanner.ErrCode(err) != codes.NotFound {
return &Error{
Code: ErrorCodeEnsureMigrationTable,
err: err,
}
}

stmt := fmt.Sprintf("CREATE TABLE `%s` ("+`
Version INT64 NOT NULL,
Expand Down
1 change: 1 addition & 0 deletions pkg/spanner/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
ErrorCodeWaitOperation
ErrorCodeCreateInstance
ErrorCodeDeleteInstance
ErrorCodeEnsureMigrationTable
)

type Error struct {
Expand Down
Loading