Skip to content

Commit

Permalink
ddl f
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Jan 16, 2025
1 parent 79f0c88 commit a286ebb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions storage/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"io"
"net/http"
"os"
"regexp"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -539,17 +538,14 @@ func newSpannerSequencer(ctx context.Context, spannerDB string, maxOutstanding u
// This table coordinates integration of the batches of entries stored in
// Seq into the committed tree state.
func (s *spannerSequencer) initDB(ctx context.Context, spannerDB string) error {
bits := regexp.MustCompile("^(.*)/databases/(.*)$").FindStringSubmatch(spannerDB)
if len(bits) != 3 {
return fmt.Errorf("invalid database id %s", spannerDB)
}
adminClient, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
return err
}
defer adminClient.Close()

op, err := adminClient.UpdateDatabaseDdl(ctx, &adminpb.UpdateDatabaseDdlRequest{
Database: spannerDB,
Statements: []string{
"CREATE TABLE IF NOT EXISTS Tessera (id INT64 NOT NULL, compatibilityVersion INT64 NOT NULL) PRIMARY KEY (id)",
"CREATE TABLE IF NOT EXISTS SeqCoord (id INT64 NOT NULL, next INT64 NOT NULL,) PRIMARY KEY (id)",
Expand Down

0 comments on commit a286ebb

Please sign in to comment.