Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: branch store update (#9835)

Danny Xu5d118c797d7e
diff --git a/backend/api/v1/branch_service.go b/backend/api/v1/branch_service.go
index f2c27dd2dd..235b8c3fec 100644
--- a/backend/api/v1/branch_service.go
+++ b/backend/api/v1/branch_service.go
@@ -160,6 +160,8 @@ func (s *BranchService) CreateBranch(ctx context.Context, request *v1pb.CreateBr
Engine: parentBranch.Engine,
Base: parentBranch.Head,
Head: parentBranch.Head,
+ BaseSchema: parentBranch.HeadSchema,
+ HeadSchema: parentBranch.HeadSchema,
Config: &storepb.BranchConfig{
SourceBranch: request.Branch.ParentBranch,
SourceDatabase: parentBranch.Config.GetSourceDatabase(),
@@ -202,15 +204,15 @@ func (s *BranchService) CreateBranch(ctx context.Context, request *v1pb.CreateBr
ResourceID: branchID,
Engine: instance.Engine,
Base: &storepb.BranchSnapshot{
- Schema: databaseSchema.GetSchema(),
Metadata: databaseSchema.GetMetadata(),
DatabaseConfig: databaseSchema.GetConfig(),
},
Head: &storepb.BranchSnapshot{
- Schema: databaseSchema.GetSchema(),
Metadata: databaseSchema.GetMetadata(),
DatabaseConfig: databaseSchema.GetConfig(),
},
+ BaseSchema: databaseSchema.GetSchema(),
+ HeadSchema: databaseSchema.GetSchema(),
Config: &storepb.BranchConfig{
SourceDatabase: request.Branch.BaselineDatabase,
},
@@ -280,17 +282,18 @@ func (s *BranchService) UpdateBranch(ctx context.Context, request *v1pb.UpdateBr
metadata, config := convertV1DatabaseMetadata(request.Branch.GetSchemaMetadata())
sanitizeCommentForSchemaMetadata(metadata)
- schema, err := getDesignSchema(branch.Engine, string(branch.Head.GetSchema()), metadata)
+ schema, err := getDesignSchema(branch.Engine, string(branch.BaseSchema), metadata)
if err != nil {
return nil, err
}
+ schemaBytes := []byte(schema)
headUpdate := &storepb.BranchSnapshot{
- Schema: []byte(schema),
Metadata: metadata,
DatabaseConfig: config,
}
updateBranchMessage := &store.UpdateBranchMessage{ProjectID: project.ResourceID, ResourceID: branchID, UpdaterID: principalID}
updateBranchMessage.Head = headUpdate
+ updateBranchMessage.HeadSchema = &schemaBytes
if err := s.store.UpdateBranch(ctx, updateBranchMessage); err != nil {
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to update branch, error %v", err))
}
@@ -376,7 +379,7 @@ func (s *BranchService) MergeBranch(ctx context.Context, request *v1pb.MergeBran
// TODO(zp): bug, this should not be no change.
return nil, status.Errorf(codes.FailedPrecondition, "failed to merge branch: no change")
}
- mergedSchema, err = getDesignSchema(storepb.Engine(baseBranch.Engine), string(headBranch.Head.Schema), mergedMetadata)
+ mergedSchema, err = getDesignSchema(storepb.Engine(baseBranch.Engine), string(headBranch.HeadSchema), mergedMetadata)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert merged metadata to schema string, %v", err)
}
@@ -389,15 +392,17 @@ func (s *BranchService) MergeBranch(ctx context.Context, request *v1pb.MergeBran
if !ok {
return nil, status.Errorf(codes.Internal, "principal ID not found")
}
+ mergedSchemaBytes := []byte(mergedSchema)
if err := s.store.UpdateBranch(ctx, &store.UpdateBranchMessage{
ProjectID: baseProject.ResourceID,
ResourceID: baseBranchID,
UpdaterID: principalID,
Head: &storepb.BranchSnapshot{
- Schema: []byte(mergedSchema),
Metadata: mergedMetadata,
DatabaseConfig: mergedConfig,
- }}); err != nil {
+ },
+ HeadSchema: &mergedSchemaBytes,
+ }); err != nil {
return nil, status.Errorf(codes.Internal, "failed update branch, error %v", err)
}
baseBranch, err = s.store.GetBranch(ctx, &store.FindBranchMessage{ProjectID: &baseProject.ResourceID, ResourceID: &baseBranchID})
@@ -462,7 +467,7 @@ func (s *BranchService) RebaseBranch(ctx context.Context, request *v1pb.RebaseBr
// TODO(zp): bug, this should not be no change.
return nil, status.Errorf(codes.FailedPrecondition, "failed to rebase branch: no change")
}
- newHeadSchema, err = getDesignSchema(storepb.Engine(baseBranch.Engine), string(baseBranch.Head.Schema), mergedTarget)
+ newHeadSchema, err = getDesignSchema(storepb.Engine(baseBranch.Engine), string(baseBranch.HeadSchema), mergedTarget)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert merged metadata to schema string, %v", err)
}
@@ -481,20 +486,23 @@ func (s *BranchService) RebaseBranch(ctx context.Context, request *v1pb.RebaseBr
if !ok {
return nil, status.Errorf(codes.Internal, "principal ID not found")
}
+ newBaseSchemaBytes := []byte(newBaseSchema)
+ newHeadSchemaBytes := []byte(newHeadSchema)
if err := s.store.UpdateBranch(ctx, &store.UpdateBranchMessage{
ProjectID: baseProject.ResourceID,
ResourceID: baseBranchID,
UpdaterID: principalID,
Base: &storepb.BranchSnapshot{
- Schema: []byte(newBaseSchema),
Metadata: newBaseMetadata,
// TODO(d): handle config.
},
+ BaseSchema: &newBaseSchemaBytes,
Head: &storepb.BranchSnapshot{
- Schema: []byte(newHeadSchema),
Metadata: newHeadMetadata,
// TODO(d): handle config.
- }}); err != nil {
+ },
+ HeadSchema: &newHeadSchemaBytes,
+ }); err != nil {
return nil, status.Errorf(codes.Internal, "failed update branch, error %v", err)
}
baseBranch, err = s.store.GetBranch(ctx, &store.FindBranchMessage{ProjectID: &baseProject.ResourceID, ResourceID: &baseBranchID})
@@ -554,7 +562,7 @@ func (s *BranchService) getNewBaseFromRebaseRequest(ctx context.Context, request
if sourceBranch == nil {
return "", status.Errorf(codes.NotFound, "branch %q not found", sourceBranchID)
}
- return string(sourceBranch.Head.Schema), nil
+ return string(sourceBranch.HeadSchema), nil
}
return "", status.Errorf(codes.InvalidArgument, "either source_database or source_branch should be specified")
@@ -782,9 +790,9 @@ func (s *BranchService) convertBranchToBranch(ctx context.Context, project *stor
return schemaDesign, nil
}
- schemaDesign.Schema = string(branch.Head.Schema)
+ schemaDesign.Schema = string(branch.HeadSchema)
schemaDesign.SchemaMetadata = convertStoreDatabaseMetadata(branch.Head.Metadata, branch.Head.DatabaseConfig, v1pb.DatabaseMetadataView_DATABASE_METADATA_VIEW_FULL, nil /* filter */)
- schemaDesign.BaselineSchema = string(branch.Base.Schema)
+ schemaDesign.BaselineSchema = string(branch.BaseSchema)
schemaDesign.BaselineSchemaMetadata = convertStoreDatabaseMetadata(branch.Base.Metadata, branch.Base.DatabaseConfig, v1pb.DatabaseMetadataView_DATABASE_METADATA_VIEW_FULL, nil /* filter */)
return schemaDesign, nil
}
diff --git a/backend/server/backfill.go b/backend/server/backfill.go
index 55a61dddc5..7165d07eca 100644
--- a/backend/server/backfill.go
+++ b/backend/server/backfill.go
@@ -22,13 +22,13 @@ func backfillBranches(ctx context.Context, stores *store.Store) {
slog.Error("failed to get branch", slog.Int("branchID", id), log.BBError(err))
continue
}
- headMetadata, err := apiv1.TransformSchemaStringToDatabaseMetadata(branch.Engine, string(branch.Head.Schema))
+ headMetadata, err := apiv1.TransformSchemaStringToDatabaseMetadata(branch.Engine, string(branch.HeadSchema))
if err != nil {
slog.Error("failed to transform head metadata", slog.Int("branchID", id), log.BBError(err))
continue
}
branch.Head.Metadata = headMetadata
- baseMetadata, err := apiv1.TransformSchemaStringToDatabaseMetadata(branch.Engine, string(branch.Base.Schema))
+ baseMetadata, err := apiv1.TransformSchemaStringToDatabaseMetadata(branch.Engine, string(branch.BaseSchema))
if err != nil {
slog.Error("failed to transform head metadata", slog.Int("branchID", id), log.BBError(err))
continue
diff --git a/backend/store/branch.go b/backend/store/branch.go
index 5cdb18edb8..ac0af47b85 100644
--- a/backend/store/branch.go
+++ b/backend/store/branch.go
@@ -18,10 +18,12 @@ type BranchMessage struct {
ProjectID string
ResourceID string
- Engine storepb.Engine
- Config *storepb.BranchConfig
- Base *storepb.BranchSnapshot
- Head *storepb.BranchSnapshot
+ Engine storepb.Engine
+ Config *storepb.BranchConfig
+ Base *storepb.BranchSnapshot
+ Head *storepb.BranchSnapshot
+ BaseSchema []byte
+ HeadSchema []byte
// Output only fields
UID int
@@ -48,6 +50,8 @@ type UpdateBranchMessage struct {
Config *storepb.BranchConfig
Base *storepb.BranchSnapshot
Head *storepb.BranchSnapshot
+ BaseSchema *[]byte
+ HeadSchema *[]byte
UpdateResourceID *string
}
@@ -102,6 +106,8 @@ func (s *Store) ListBranches(ctx context.Context, find *FindBranchMessage) ([]*B
branch.engine,
branch.base,
branch.head,
+ branch.base_schema,
+ branch.head_schema,
branch.config
FROM branch
LEFT JOIN project ON branch.project_id = project.id
@@ -130,6 +136,8 @@ func (s *Store) ListBranches(ctx context.Context, find *FindBranchMessage) ([]*B
&engine,
&base,
&head,
+ &branch.BaseSchema,
+ &branch.HeadSchema,
&config,
); err != nil {
return nil, err
@@ -208,9 +216,11 @@ func (s *Store) CreateBranch(ctx context.Context, create *BranchMessage) (*Branc
engine,
base,
head,
+ base_schema,
+ head_schema,
config
)
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
RETURNING id, created_ts, updated_ts;
`
@@ -228,6 +238,9 @@ func (s *Store) CreateBranch(ctx context.Context, create *BranchMessage) (*Branc
create.Engine.String(),
base,
head,
+ // Convert to string because []byte{} is null which violates db schema constraints.
+ string(create.BaseSchema),
+ string(create.HeadSchema),
config,
).Scan(
&create.UID,
@@ -272,6 +285,13 @@ func (s *Store) UpdateBranch(ctx context.Context, update *UpdateBranchMessage) e
}
set, args = append(set, fmt.Sprintf("head = $%d", len(args)+1)), append(args, head)
}
+ // Convert to string because []byte{} is null which violates db schema constraints.
+ if v := update.BaseSchema; v != nil {
+ set, args = append(set, fmt.Sprintf("base_schema = $%d", len(args)+1)), append(args, string(*v))
+ }
+ if v := update.HeadSchema; v != nil {
+ set, args = append(set, fmt.Sprintf("head_schema = $%d", len(args)+1)), append(args, string(*v))
+ }
if v := update.Config; v != nil {
config, err := protojson.Marshal(v)
if err != nil {
diff --git a/frontend/src/types/proto/store/branch.ts b/frontend/src/types/proto/store/branch.ts
index 307841fcbf..b1e23b6acd 100644
--- a/frontend/src/types/proto/store/branch.ts
+++ b/frontend/src/types/proto/store/branch.ts
@@ -6,7 +6,6 @@ import { DatabaseConfig, DatabaseSchemaMetadata } from "./database";
export const protobufPackage = "bytebase.store";
export interface BranchSnapshot {
- schema: Uint8Array;
metadata: DatabaseSchemaMetadata | undefined;
databaseConfig: DatabaseConfig | undefined;
}
@@ -27,19 +26,16 @@ export interface BranchConfig {
}
function createBaseBranchSnapshot(): BranchSnapshot {
- return { schema: new Uint8Array(0), metadata: undefined, databaseConfig: undefined };
+ return { metadata: undefined, databaseConfig: undefined };
}
export const BranchSnapshot = {
encode(message: BranchSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
- if (message.schema.length !== 0) {
- writer.uint32(10).bytes(message.schema);
- }
if (message.metadata !== undefined) {
- DatabaseSchemaMetadata.encode(message.metadata, writer.uint32(18).fork()).ldelim();
+ DatabaseSchemaMetadata.encode(message.metadata, writer.uint32(10).fork()).ldelim();
}
if (message.databaseConfig !== undefined) {
- DatabaseConfig.encode(message.databaseConfig, writer.uint32(26).fork()).ldelim();
+ DatabaseConfig.encode(message.databaseConfig, writer.uint32(18).fork()).ldelim();
}
return writer;
},
@@ -56,20 +52,13 @@ export const BranchSnapshot = {
break;
}
- message.schema = reader.bytes();
+ message.metadata = DatabaseSchemaMetadata.decode(reader, reader.uint32());
continue;
case 2:
if (tag !== 18) {
break;
}
- message.metadata = DatabaseSchemaMetadata.decode(reader, reader.uint32());
- continue;
- case 3:
- if (tag !== 26) {
- break;
- }
-
message.databaseConfig = DatabaseConfig.decode(reader, reader.uint32());
continue;
}
@@ -83,7 +72,6 @@ export const BranchSnapshot = {
fromJSON(object: any): BranchSnapshot {
return {
- schema: isSet(object.schema) ? bytesFromBase64(object.schema) : new Uint8Array(0),
metadata: isSet(object.metadata) ? DatabaseSchemaMetadata.fromJSON(object.metadata) : undefined,
databaseConfig: isSet(object.databaseConfig) ? DatabaseConfig.fromJSON(object.databaseConfig) : undefined,
};
@@ -91,9 +79,6 @@ export const BranchSnapshot = {
toJSON(message: BranchSnapshot): unknown {
const obj: any = {};
- if (message.schema.length !== 0) {
- obj.schema = base64FromBytes(message.schema);
- }
if (message.metadata !== undefined) {
obj.metadata = DatabaseSchemaMetadata.toJSON(message.metadata);
}
@@ -108,7 +93,6 @@ export const BranchSnapshot = {
},
fromPartial(object: DeepPartial<BranchSnapshot>): BranchSnapshot {
const message = createBaseBranchSnapshot();
- message.schema = object.schema ?? new Uint8Array(0);
message.metadata = (object.metadata !== undefined && object.metadata !== null)
? DatabaseSchemaMetadata.fromPartial(object.metadata)
: undefined;
@@ -193,31 +177,6 @@ export const BranchConfig = {
},
};
-function bytesFromBase64(b64: string): Uint8Array {
- if (globalThis.Buffer) {
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
- } else {
- const bin = globalThis.atob(b64);
- const arr = new Uint8Array(bin.length);
- for (let i = 0; i < bin.length; ++i) {
- arr[i] = bin.charCodeAt(i);
- }
- return arr;
- }
-}
-
-function base64FromBytes(arr: Uint8Array): string {
- if (globalThis.Buffer) {
- return globalThis.Buffer.from(arr).toString("base64");
- } else {
- const bin: string[] = [];
- arr.forEach((byte) => {
- bin.push(globalThis.String.fromCharCode(byte));
- });
- return globalThis.btoa(bin.join(""));
- }
-}
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index b550ea7611..c70be321d3 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -1077,7 +1077,6 @@ ViewMetadata is the metadata for views.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| schema | [bytes](#bytes) | | |
| metadata | [DatabaseSchemaMetadata](#bytebase-store-DatabaseSchemaMetadata) | | |
| database_config | [DatabaseConfig](#bytebase-store-DatabaseConfig) | | |
diff --git a/proto/generated-go/store/branch.pb.go b/proto/generated-go/store/branch.pb.go
index 5d7eb69c94..677c6e1f32 100644
--- a/proto/generated-go/store/branch.pb.go
+++ b/proto/generated-go/store/branch.pb.go
@@ -25,9 +25,8 @@ type BranchSnapshot struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Schema []byte `protobuf:"bytes,1,opt,name=schema,proto3" json:"schema,omitempty"`
- Metadata *DatabaseSchemaMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata,omitempty"`
- DatabaseConfig *DatabaseConfig `protobuf:"bytes,3,opt,name=database_config,json=databaseConfig,proto3" json:"database_config,omitempty"`
+ Metadata *DatabaseSchemaMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
+ DatabaseConfig *DatabaseConfig `protobuf:"bytes,2,opt,name=database_config,json=databaseConfig,proto3" json:"database_config,omitempty"`
}
func (x *BranchSnapshot) Reset() {
@@ -62,13 +61,6 @@ func (*BranchSnapshot) Descriptor() ([]byte, []int) {
return file_store_branch_proto_rawDescGZIP(), []int{0}
}
-func (x *BranchSnapshot) GetSchema() []byte {
- if x != nil {
- return x.Schema
- }
- return nil
-}
-
func (x *BranchSnapshot) GetMetadata() *DatabaseSchemaMetadata {
if x != nil {
return x.Metadata
@@ -150,26 +142,25 @@ var file_store_branch_proto_rawDesc = []byte{
0x0a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
0x74, 0x6f, 0x72, 0x65, 0x1a, 0x14, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x01, 0x0a, 0x0e, 0x42,
- 0x72, 0x61, 0x6e, 0x63, 0x68, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x16, 0x0a,
- 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73,
- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x42, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
- 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
- 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52,
- 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x0f, 0x64, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
- 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x52, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x22, 0x5c, 0x0a, 0x0c, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66,
- 0x69, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74,
- 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x6f, 0x75,
- 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73,
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
- 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f,
- 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x01, 0x0a, 0x0e, 0x42,
+ 0x72, 0x61, 0x6e, 0x63, 0x68, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x42, 0x0a,
+ 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x4d,
+ 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+ 0x61, 0x12, 0x47, 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x64, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x5c, 0x0a, 0x0c, 0x42, 0x72,
+ 0x61, 0x6e, 0x63, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x72,
+ 0x61, 0x6e, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72,
+ 0x63, 0x65, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/store/branch.proto b/proto/store/branch.proto
index 86a1069463..b56b3f3906 100644
--- a/proto/store/branch.proto
+++ b/proto/store/branch.proto
@@ -7,9 +7,8 @@ import "store/database.proto";
option go_package = "generated-go/store";
message BranchSnapshot {
- bytes schema = 1;
- DatabaseSchemaMetadata metadata = 2;
- DatabaseConfig database_config = 3;
+ DatabaseSchemaMetadata metadata = 1;
+ DatabaseConfig database_config = 2;
}
message BranchConfig {