Skip to content

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

feat(executor): set database config in post migration stage (#8499)

h3n4l6bc12a957f54
diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.go
index f4061baaa1..bc1c290014 100644
--- a/backend/runner/taskrun/executor.go
+++ b/backend/runner/taskrun/executor.go
@@ -389,7 +389,7 @@ func setMigrationIDAndEndBinlogCoordinate(ctx context.Context, conn *sql.Conn, t
return updatedTask, nil
}
-func postMigration(ctx context.Context, stores *store.Store, activityManager *activity.Manager, license enterpriseAPI.LicenseService, task *store.TaskMessage, mi *db.MigrationInfo, migrationID string, schema string) (bool, *api.TaskRunResultPayload, error) {
+func postMigration(ctx context.Context, stores *store.Store, activityManager *activity.Manager, license enterpriseAPI.LicenseService, task *store.TaskMessage, mi *db.MigrationInfo, migrationID string, schema string, sheetID *int) (bool, *api.TaskRunResultPayload, error) {
instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
if err != nil {
return true, nil, err
@@ -518,6 +518,23 @@ func postMigration(ctx context.Context, stores *store.Store, activityManager *ac
}
}
+ // Set schema config.
+ if sheetID != nil && task.DatabaseID != nil {
+ sheet, err := stores.GetSheet(ctx, &store.FindSheetMessage{
+ UID: sheetID,
+ }, api.SystemBotID)
+ if err != nil {
+ slog.Error("Failed to get sheet from store", slog.Int("sheetID", *sheetID), log.BBError(err))
+ } else if sheet.Payload.DatabaseConfig != nil {
+ err = stores.UpdateDBSchema(ctx, *task.DatabaseID, &store.UpdateDBSchemaMessage{
+ Config: sheet.Payload.DatabaseConfig,
+ }, api.SystemBotID)
+ if err != nil {
+ slog.Error("Failed to update database config", slog.Int("sheetID", *sheetID), slog.Int("databaseUID", *task.DatabaseID), log.BBError(err))
+ }
+ }
+ }
+
// Remove schema drift anomalies.
if err := stores.ArchiveAnomalyV2(ctx, &store.ArchiveAnomalyMessage{
DatabaseUID: task.DatabaseID,
@@ -616,7 +633,7 @@ func runMigration(ctx context.Context, driverCtx context.Context, store *store.S
if err != nil {
return true, nil, err
}
- return postMigration(ctx, store, activityManager, license, task, mi, migrationID, schema)
+ return postMigration(ctx, store, activityManager, license, task, mi, migrationID, schema, sheetID)
}
// Writes back the latest schema to the repository after migration.
diff --git a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go b/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
index 98b788472c..6268f7ae8c 100644
--- a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
+++ b/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
@@ -151,7 +151,7 @@ func cutover(ctx context.Context, stores *store.Store, dbFactory *dbfactory.DBFa
return true, nil, err
}
- return postMigration(ctx, stores, activityManager, license, task, mi, migrationID, schema)
+ return postMigration(ctx, stores, activityManager, license, task, mi, migrationID, schema, &sheetID)
}
func waitForCutover(ctx context.Context, migrationContext *base.MigrationContext) bool {
diff --git a/frontend/src/types/proto/store/sheet.ts b/frontend/src/types/proto/store/sheet.ts
index 37e37fbdbe..87611ed281 100644
--- a/frontend/src/types/proto/store/sheet.ts
+++ b/frontend/src/types/proto/store/sheet.ts
@@ -2,7 +2,7 @@
import Long from "long";
import _m0 from "protobufjs/minimal";
import { Engine, engineFromJSON, engineToJSON } from "./common";
-import { SchemaConfig } from "./database";
+import { DatabaseConfig } from "./database";
import { PushEvent } from "./vcs";
export const protobufPackage = "bytebase.store";
@@ -13,8 +13,8 @@ export interface SheetPayload {
schemaDesign:
| SheetPayload_SchemaDesign
| undefined;
- /** schema_config will be apply to the given database after executing statement, only be used in schema design for now. */
- schemaConfig: SchemaConfig | undefined;
+ /** database_config will be apply to the given database after executing statement, only be used in schema design for now. */
+ databaseConfig?: DatabaseConfig | undefined;
}
/** Type of the SheetPayload. */
@@ -123,7 +123,7 @@ export interface SheetPayload_SchemaDesign_Protection {
}
function createBaseSheetPayload(): SheetPayload {
- return { type: 0, vcsPayload: undefined, schemaDesign: undefined, schemaConfig: undefined };
+ return { type: 0, vcsPayload: undefined, schemaDesign: undefined, databaseConfig: undefined };
}
export const SheetPayload = {
@@ -137,8 +137,8 @@ export const SheetPayload = {
if (message.schemaDesign !== undefined) {
SheetPayload_SchemaDesign.encode(message.schemaDesign, writer.uint32(26).fork()).ldelim();
}
- if (message.schemaConfig !== undefined) {
- SchemaConfig.encode(message.schemaConfig, writer.uint32(34).fork()).ldelim();
+ if (message.databaseConfig !== undefined) {
+ DatabaseConfig.encode(message.databaseConfig, writer.uint32(34).fork()).ldelim();
}
return writer;
},
@@ -176,7 +176,7 @@ export const SheetPayload = {
break;
}
- message.schemaConfig = SchemaConfig.decode(reader, reader.uint32());
+ message.databaseConfig = DatabaseConfig.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -192,7 +192,7 @@ export const SheetPayload = {
type: isSet(object.type) ? sheetPayload_TypeFromJSON(object.type) : 0,
vcsPayload: isSet(object.vcsPayload) ? SheetPayload_VCSPayload.fromJSON(object.vcsPayload) : undefined,
schemaDesign: isSet(object.schemaDesign) ? SheetPayload_SchemaDesign.fromJSON(object.schemaDesign) : undefined,
- schemaConfig: isSet(object.schemaConfig) ? SchemaConfig.fromJSON(object.schemaConfig) : undefined,
+ databaseConfig: isSet(object.databaseConfig) ? DatabaseConfig.fromJSON(object.databaseConfig) : undefined,
};
},
@@ -203,8 +203,8 @@ export const SheetPayload = {
(obj.vcsPayload = message.vcsPayload ? SheetPayload_VCSPayload.toJSON(message.vcsPayload) : undefined);
message.schemaDesign !== undefined &&
(obj.schemaDesign = message.schemaDesign ? SheetPayload_SchemaDesign.toJSON(message.schemaDesign) : undefined);
- message.schemaConfig !== undefined &&
- (obj.schemaConfig = message.schemaConfig ? SchemaConfig.toJSON(message.schemaConfig) : undefined);
+ message.databaseConfig !== undefined &&
+ (obj.databaseConfig = message.databaseConfig ? DatabaseConfig.toJSON(message.databaseConfig) : undefined);
return obj;
},
@@ -221,8 +221,8 @@ export const SheetPayload = {
message.schemaDesign = (object.schemaDesign !== undefined && object.schemaDesign !== null)
? SheetPayload_SchemaDesign.fromPartial(object.schemaDesign)
: undefined;
- message.schemaConfig = (object.schemaConfig !== undefined && object.schemaConfig !== null)
- ? SchemaConfig.fromPartial(object.schemaConfig)
+ message.databaseConfig = (object.databaseConfig !== undefined && object.databaseConfig !== null)
+ ? DatabaseConfig.fromPartial(object.databaseConfig)
: undefined;
return message;
},
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 86e5f561bc..3e7a6e2859 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -2544,7 +2544,7 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
| type | [SheetPayload.Type](#bytebase-store-SheetPayload-Type) | | |
| vcs_payload | [SheetPayload.VCSPayload](#bytebase-store-SheetPayload-VCSPayload) | | |
| schema_design | [SheetPayload.SchemaDesign](#bytebase-store-SheetPayload-SchemaDesign) | | |
-| schema_config | [SchemaConfig](#bytebase-store-SchemaConfig) | | schema_config will be apply to the given database after executing statement, only be used in schema design for now. |
+| database_config | [DatabaseConfig](#bytebase-store-DatabaseConfig) | optional | database_config will be apply to the given database after executing statement, only be used in schema design for now. |
diff --git a/proto/generated-go/store/sheet.pb.go b/proto/generated-go/store/sheet.pb.go
index 817af972cf..e3aa1a7850 100644
--- a/proto/generated-go/store/sheet.pb.go
+++ b/proto/generated-go/store/sheet.pb.go
@@ -126,8 +126,8 @@ type SheetPayload struct {
Type SheetPayload_Type `protobuf:"varint,1,opt,name=type,proto3,enum=bytebase.store.SheetPayload_Type" json:"type,omitempty"`
VcsPayload *SheetPayload_VCSPayload `protobuf:"bytes,2,opt,name=vcs_payload,json=vcsPayload,proto3" json:"vcs_payload,omitempty"`
SchemaDesign *SheetPayload_SchemaDesign `protobuf:"bytes,3,opt,name=schema_design,json=schemaDesign,proto3" json:"schema_design,omitempty"`
- // schema_config will be apply to the given database after executing statement, only be used in schema design for now.
- SchemaConfig *SchemaConfig `protobuf:"bytes,4,opt,name=schema_config,json=schemaConfig,proto3" json:"schema_config,omitempty"`
+ // database_config will be apply to the given database after executing statement, only be used in schema design for now.
+ DatabaseConfig *DatabaseConfig `protobuf:"bytes,4,opt,name=database_config,json=databaseConfig,proto3,oneof" json:"database_config,omitempty"`
}
func (x *SheetPayload) Reset() {
@@ -183,9 +183,9 @@ func (x *SheetPayload) GetSchemaDesign() *SheetPayload_SchemaDesign {
return nil
}
-func (x *SheetPayload) GetSchemaConfig() *SchemaConfig {
+func (x *SheetPayload) GetDatabaseConfig() *DatabaseConfig {
if x != nil {
- return x.SchemaConfig
+ return x.DatabaseConfig
}
return nil
}
@@ -434,7 +434,7 @@ var file_store_sheet_proto_rawDesc = []byte{
0x6f, 0x72, 0x65, 0x1a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x64,
0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x73,
- 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8,
+ 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7,
0x08, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12,
0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e,
0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53,
@@ -449,63 +449,65 @@ var file_store_sheet_proto_rawDesc = []byte{
0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61,
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
0x67, 0x6e, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e,
- 0x12, 0x41, 0x0a, 0x0d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69,
- 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43,
- 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x1a, 0xf4, 0x01, 0x0a, 0x0a, 0x56, 0x43, 0x53, 0x50, 0x61, 0x79, 0x6c, 0x6f,
- 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12,
- 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04,
- 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65,
- 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74,
- 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x20,
- 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x73, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x73,
- 0x12, 0x38, 0x0a, 0x0a, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x07,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52,
- 0x09, 0x70, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0xfb, 0x03, 0x0a, 0x0c, 0x53,
- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x42, 0x0a, 0x04, 0x74,
- 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74,
- 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
- 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
- 0x2e, 0x0a, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12,
- 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x68, 0x65, 0x65,
- 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x61, 0x73, 0x65,
- 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x19, 0x62,
- 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64,
- 0x65, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16,
- 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65,
- 0x73, 0x69, 0x67, 0x6e, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69,
- 0x6e, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72,
- 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x62, 0x61, 0x73, 0x65,
- 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
- 0x79, 0x49, 0x64, 0x12, 0x54, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61,
- 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69,
- 0x67, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70,
- 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x3a, 0x0a, 0x0a, 0x50, 0x72, 0x6f,
- 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77,
- 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x50,
- 0x75, 0x73, 0x68, 0x65, 0x73, 0x22, 0x41, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a,
- 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
- 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x5f, 0x42, 0x52, 0x41, 0x4e,
- 0x43, 0x48, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x45, 0x52, 0x53, 0x4f, 0x4e, 0x41, 0x4c,
- 0x5f, 0x44, 0x52, 0x41, 0x46, 0x54, 0x10, 0x02, 0x22, 0x2f, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65,
- 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
- 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41,
- 0x5f, 0x44, 0x45, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x01, 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,
+ 0x12, 0x4c, 0x0a, 0x0f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x18, 0x04, 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, 0x48, 0x00, 0x52, 0x0e, 0x64, 0x61, 0x74,
+ 0x61, 0x62, 0x61, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x1a, 0xf4,
+ 0x01, 0x0a, 0x0a, 0x56, 0x43, 0x53, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a,
+ 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69,
+ 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66,
+ 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61,
+ 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74,
+ 0x68, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73,
+ 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x61, 0x73,
+ 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
+ 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x70,
+ 0x75, 0x73, 0x68, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
+ 0x2e, 0x50, 0x75, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x70, 0x75, 0x73, 0x68,
+ 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0xfb, 0x03, 0x0a, 0x0c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61,
+ 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x42, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f,
+ 0x61, 0x64, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x2e,
+ 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x65, 0x6e,
+ 0x67, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x45, 0x6e, 0x67, 0x69,
+ 0x6e, 0x65, 0x52, 0x06, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61,
+ 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53,
+ 0x68, 0x65, 0x65, 0x74, 0x49, 0x64, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69,
+ 0x6e, 0x65, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e,
+ 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x62, 0x61, 0x73, 0x65, 0x6c,
+ 0x69, 0x6e, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x49,
+ 0x64, 0x12, 0x3b, 0x0a, 0x1a, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x63, 0x68,
+ 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18,
+ 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x43,
+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x54,
+ 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
+ 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
+ 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x44, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x2e, 0x50, 0x72,
+ 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x3a, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x66, 0x6f, 0x72, 0x63,
+ 0x65, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10,
+ 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x50, 0x75, 0x73, 0x68, 0x65, 0x73,
+ 0x22, 0x41, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f,
+ 0x0a, 0x0b, 0x4d, 0x41, 0x49, 0x4e, 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x10, 0x01, 0x12,
+ 0x12, 0x0a, 0x0e, 0x50, 0x45, 0x52, 0x53, 0x4f, 0x4e, 0x41, 0x4c, 0x5f, 0x44, 0x52, 0x41, 0x46,
+ 0x54, 0x10, 0x02, 0x22, 0x2f, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54,
+ 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
+ 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x44, 0x45, 0x53, 0x49,
+ 0x47, 0x4e, 0x10, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73,
+ 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 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 (
@@ -529,7 +531,7 @@ var file_store_sheet_proto_goTypes = []interface{}{
(*SheetPayload_VCSPayload)(nil), // 3: bytebase.store.SheetPayload.VCSPayload
(*SheetPayload_SchemaDesign)(nil), // 4: bytebase.store.SheetPayload.SchemaDesign
(*SheetPayload_SchemaDesign_Protection)(nil), // 5: bytebase.store.SheetPayload.SchemaDesign.Protection
- (*SchemaConfig)(nil), // 6: bytebase.store.SchemaConfig
+ (*DatabaseConfig)(nil), // 6: bytebase.store.DatabaseConfig
(*PushEvent)(nil), // 7: bytebase.store.PushEvent
(Engine)(0), // 8: bytebase.store.Engine
}
@@ -537,7 +539,7 @@ var file_store_sheet_proto_depIdxs = []int32{
0, // 0: bytebase.store.SheetPayload.type:type_name -> bytebase.store.SheetPayload.Type
3, // 1: bytebase.store.SheetPayload.vcs_payload:type_name -> bytebase.store.SheetPayload.VCSPayload
4, // 2: bytebase.store.SheetPayload.schema_design:type_name -> bytebase.store.SheetPayload.SchemaDesign
- 6, // 3: bytebase.store.SheetPayload.schema_config:type_name -> bytebase.store.SchemaConfig
+ 6, // 3: bytebase.store.SheetPayload.database_config:type_name -> bytebase.store.DatabaseConfig
7, // 4: bytebase.store.SheetPayload.VCSPayload.push_event:type_name -> bytebase.store.PushEvent
1, // 5: bytebase.store.SheetPayload.SchemaDesign.type:type_name -> bytebase.store.SheetPayload.SchemaDesign.Type
8, // 6: bytebase.store.SheetPayload.SchemaDesign.engine:type_name -> bytebase.store.Engine
@@ -607,6 +609,7 @@ func file_store_sheet_proto_init() {
}
}
}
+ file_store_sheet_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
diff --git a/proto/store/sheet.proto b/proto/store/sheet.proto
index 50ef297384..4338601757 100644
--- a/proto/store/sheet.proto
+++ b/proto/store/sheet.proto
@@ -56,6 +56,6 @@ message SheetPayload {
}
SchemaDesign schema_design = 3;
- // schema_config will be apply to the given database after executing statement, only be used in schema design for now.
- SchemaConfig schema_config = 4;
+ // database_config will be apply to the given database after executing statement, only be used in schema design for now.
+ optional DatabaseConfig database_config = 4;
}