Skip to content

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

chore: support set database group in connector (#11458)

ecmadaoedcbaf1c69aa
diff --git a/backend/api/gitops/webhook.go b/backend/api/gitops/webhook.go
index bf17eefeab..af53613255 100644
--- a/backend/api/gitops/webhook.go
+++ b/backend/api/gitops/webhook.go
@@ -169,22 +169,6 @@ func (s *Service) createIssueFromPRInfo(ctx context.Context, project *store.Proj
creatorID = user.ID
}
- databases, err := s.store.ListDatabases(ctx, &store.FindDatabaseMessage{ProjectID: &project.ResourceID})
- if err != nil {
- return err
- }
- environments, err := s.store.ListEnvironmentV2(ctx, &store.FindEnvironmentMessage{})
- if err != nil {
- return err
- }
- environmentOrders := make(map[string]int32)
- for _, environment := range environments {
- environmentOrders[environment.ResourceID] = environment.Order
- }
- sort.Slice(databases, func(i, j int) bool {
- return environmentOrders[databases[i].EffectiveEnvironmentID] < environmentOrders[databases[j].EffectiveEnvironmentID]
- })
-
var sheets []int
for _, change := range prInfo.changes {
sheet, err := s.store.CreateSheet(ctx, &store.SheetMessage{
@@ -199,25 +183,9 @@ func (s *Service) createIssueFromPRInfo(ctx context.Context, project *store.Proj
sheets = append(sheets, sheet.UID)
}
- var steps []*v1pb.Plan_Step
- for i, database := range databases {
- if i == 0 || databases[i].EffectiveEnvironmentID != databases[i-1].EffectiveEnvironmentID {
- steps = append(steps, &v1pb.Plan_Step{})
- }
- step := steps[len(steps)-1]
- for i, change := range prInfo.changes {
- step.Specs = append(step.Specs, &v1pb.Plan_Spec{
- Id: uuid.NewString(),
- Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{
- ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{
- Type: change.changeType,
- Target: common.FormatDatabase(database.InstanceID, database.DatabaseName),
- Sheet: fmt.Sprintf("projects/%s/sheets/%d", project.ResourceID, sheets[i]),
- SchemaVersion: change.version,
- },
- },
- })
- }
+ steps, err := s.getChangeSteps(ctx, project, vcsConnector, prInfo.changes, sheets)
+ if err != nil {
+ return err
}
childCtx := context.WithValue(ctx, common.PrincipalIDContextKey, creatorID)
@@ -289,3 +257,79 @@ func (s *Service) createIssueFromPRInfo(ctx context.Context, project *store.Proj
}
return nil
}
+
+func (s *Service) getChangeSteps(
+ ctx context.Context,
+ project *store.ProjectMessage,
+ vcsConnector *store.VCSConnectorMessage,
+ changes []*fileChange,
+ sheetUIDList []int,
+) ([]*v1pb.Plan_Step, error) {
+ if vcsConnector.Payload.DatabaseGroup != "" {
+ step := &v1pb.Plan_Step{}
+ for i, change := range changes {
+ step.Specs = append(step.Specs, &v1pb.Plan_Spec{
+ Id: uuid.NewString(),
+ Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{
+ ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{
+ Type: change.changeType,
+ Target: vcsConnector.Payload.DatabaseGroup,
+ Sheet: fmt.Sprintf("projects/%s/sheets/%d", project.ResourceID, sheetUIDList[i]),
+ SchemaVersion: change.version,
+ },
+ },
+ })
+ }
+ return []*v1pb.Plan_Step{
+ step,
+ }, nil
+ }
+
+ databases, err := s.listDatabases(ctx, project)
+ if err != nil {
+ return nil, err
+ }
+
+ var steps []*v1pb.Plan_Step
+ for i, database := range databases {
+ if i == 0 || databases[i].EffectiveEnvironmentID != databases[i-1].EffectiveEnvironmentID {
+ steps = append(steps, &v1pb.Plan_Step{})
+ }
+ step := steps[len(steps)-1]
+ for i, change := range changes {
+ step.Specs = append(step.Specs, &v1pb.Plan_Spec{
+ Id: uuid.NewString(),
+ Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{
+ ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{
+ Type: change.changeType,
+ Target: common.FormatDatabase(database.InstanceID, database.DatabaseName),
+ Sheet: fmt.Sprintf("projects/%s/sheets/%d", project.ResourceID, sheetUIDList[i]),
+ SchemaVersion: change.version,
+ },
+ },
+ })
+ }
+ }
+
+ return steps, nil
+}
+
+func (s *Service) listDatabases(ctx context.Context, project *store.ProjectMessage) ([]*store.DatabaseMessage, error) {
+ databases, err := s.store.ListDatabases(ctx, &store.FindDatabaseMessage{ProjectID: &project.ResourceID})
+ if err != nil {
+ return nil, err
+ }
+ environments, err := s.store.ListEnvironmentV2(ctx, &store.FindEnvironmentMessage{})
+ if err != nil {
+ return nil, err
+ }
+ environmentOrders := make(map[string]int32)
+ for _, environment := range environments {
+ environmentOrders[environment.ResourceID] = environment.Order
+ }
+ sort.Slice(databases, func(i, j int) bool {
+ return environmentOrders[databases[i].EffectiveEnvironmentID] < environmentOrders[databases[j].EffectiveEnvironmentID]
+ })
+
+ return databases, nil
+}
diff --git a/backend/api/v1/vcs_connector_service.go b/backend/api/v1/vcs_connector_service.go
index 1804b3f72b..33cc3ce0c9 100644
--- a/backend/api/v1/vcs_connector_service.go
+++ b/backend/api/v1/vcs_connector_service.go
@@ -140,6 +140,7 @@ func (s *VCSConnectorService) CreateVCSConnector(ctx context.Context, request *v
BaseDirectory: baseDir,
ExternalId: request.GetVcsConnector().ExternalId,
WebhookSecretToken: secretToken,
+ DatabaseGroup: request.GetVcsConnector().DatabaseGroup,
},
}
@@ -299,6 +300,8 @@ func (s *VCSConnectorService) UpdateVCSConnector(ctx context.Context, request *v
baseDir = strings.Trim(request.GetVcsConnector().BaseDirectory, "/")
}
update.BaseDirectory = &baseDir
+ case "database_group":
+ update.DatabaseGroup = &request.GetVcsConnector().DatabaseGroup
}
}
@@ -416,6 +419,7 @@ func convertStoreVCSConnector(ctx context.Context, stores *store.Store, vcsConne
Branch: vcsConnector.Payload.Branch,
FullPath: vcsConnector.Payload.FullPath,
WebUrl: vcsConnector.Payload.WebUrl,
+ DatabaseGroup: vcsConnector.Payload.DatabaseGroup,
}
return v1VCSConnector, nil
}
diff --git a/backend/store/vcs_connector.go b/backend/store/vcs_connector.go
index f50fb4acbf..e4f3fb28df 100644
--- a/backend/store/vcs_connector.go
+++ b/backend/store/vcs_connector.go
@@ -47,6 +47,7 @@ type UpdateVCSConnectorMessage struct {
// Domain specific fields
Branch *string
BaseDirectory *string
+ DatabaseGroup *string
}
// GetVCSConnector gets a VCS connector.
@@ -201,6 +202,9 @@ func (s *Store) UpdateVCSConnector(ctx context.Context, update *UpdateVCSConnect
if v := update.BaseDirectory; v != nil {
payloadSet, args = append(payloadSet, fmt.Sprintf("jsonb_build_object('baseDirectory', to_jsonb($%d::TEXT))", len(args)+1)), append(args, *v)
}
+ if v := update.DatabaseGroup; v != nil {
+ payloadSet, args = append(payloadSet, fmt.Sprintf("jsonb_build_object('databaseGroup', to_jsonb($%d::TEXT))", len(args)+1)), append(args, *v)
+ }
if len(payloadSet) != 0 {
set = append(set, fmt.Sprintf(`payload = payload || %s`, strings.Join(payloadSet, "||")))
}
diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vue
index 1ab8bd52de..863d0b3163 100644
--- a/frontend/src/components/RepositoryForm.vue
+++ b/frontend/src/components/RepositoryForm.vue
@@ -50,6 +50,18 @@
:readonly="!create || !allowEdit"
/>
</div>
+ <div>
+ <div class="textlabel">
+ {{ $t("database-group.self") }}
+ </div>
+ <!-- TODO(ed): i18n -->
+ <DatabaseGroupSelect
+ v-model:value="repositoryConfig.databaseGroup"
+ class="mt-2"
+ style="width: 100%"
+ :project="project.name"
+ />
+ </div>
<div>
<div class="textlabel">
{{ $t("common.branch") }} <span class="text-red-600">*</span>
@@ -87,6 +99,7 @@
import { Status } from "nice-grpc-common";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
+import { DatabaseGroupSelect } from "@/components/v2/Select";
import { useVCSConnectorStore } from "@/store";
import type { RepositoryConfig } from "@/types";
import type { ResourceId, ValidatedMessage } from "@/types";
diff --git a/frontend/src/components/RepositoryPanel.vue b/frontend/src/components/RepositoryPanel.vue
index 5c1909f20f..a34ecc0e48 100644
--- a/frontend/src/components/RepositoryPanel.vue
+++ b/frontend/src/components/RepositoryPanel.vue
@@ -100,6 +100,7 @@ const state = reactive<LocalState>({
resourceId: "",
baseDirectory: "",
branch: "",
+ databaseGroup: "",
},
processing: false,
});
@@ -111,6 +112,7 @@ watch(
resourceId: getVCSConnectorId(props.vcsConnector.name).vcsConnectorId,
baseDirectory: cur.baseDirectory,
branch: cur.branch,
+ databaseGroup: cur.databaseGroup,
};
},
{ deep: true, immediate: true }
@@ -147,7 +149,9 @@ const allowUpdate = computed(() => {
!state.processing &&
!isEmpty(state.repositoryConfig.branch) &&
(props.vcsConnector.branch !== state.repositoryConfig.branch ||
- props.vcsConnector.baseDirectory !== state.repositoryConfig.baseDirectory)
+ props.vcsConnector.baseDirectory !==
+ state.repositoryConfig.baseDirectory ||
+ props.vcsConnector.databaseGroup !== state.repositoryConfig.databaseGroup)
);
});
@@ -177,8 +181,9 @@ const doUpdate = async () => {
...props.vcsConnector,
branch: state.repositoryConfig.branch,
baseDirectory: state.repositoryConfig.baseDirectory,
+ databaseGroup: state.repositoryConfig.databaseGroup,
}),
- ["branch", "base_directory"]
+ ["branch", "base_directory", "database_group"]
);
emit("update");
} finally {
diff --git a/frontend/src/components/RepositorySetupWizard.vue b/frontend/src/components/RepositorySetupWizard.vue
index b03d8a2ae8..609e3ce775 100644
--- a/frontend/src/components/RepositorySetupWizard.vue
+++ b/frontend/src/components/RepositorySetupWizard.vue
@@ -93,6 +93,7 @@ const state = reactive<LocalState>({
baseDirectory: "bytebase",
branch: "main",
resourceId: "",
+ databaseGroup: "",
},
},
currentStep: CHOOSE_PROVIDER_STEP,
@@ -151,6 +152,7 @@ const tryFinishSetup = async () => {
vcsProvider: state.config.vcs.name,
baseDirectory: state.config.repositoryConfig.baseDirectory,
branch: state.config.repositoryConfig.branch,
+ databaseGroup: state.config.repositoryConfig.databaseGroup,
fullPath: state.config.repositoryInfo.fullPath,
webUrl: state.config.repositoryInfo.webUrl,
}
diff --git a/frontend/src/components/v2/Select/DatabaseGroupSelect.vue b/frontend/src/components/v2/Select/DatabaseGroupSelect.vue
new file mode 100644
index 0000000000..cd6d08a395
--- /dev/null
+++ b/frontend/src/components/v2/Select/DatabaseGroupSelect.vue
@@ -0,0 +1,99 @@
+<template>
+ <NSelect
+ :value="value ?? null"
+ :options="options"
+ :placeholder="placeholder ?? $t('database-group.select')"
+ :virtual-scroll="true"
+ :filter="filterByName"
+ :filterable="true"
+ class="bb-databaseGroup-select"
+ style="width: 12rem"
+ v-bind="$attrs"
+ :render-label="renderLabel"
+ @update:value="$emit('update:value', $event)"
+ />
+</template>
+
+<script lang="ts" setup>
+import type { SelectOption, SelectRenderLabel } from "naive-ui";
+import { NSelect } from "naive-ui";
+import { computed, h, watch } from "vue";
+import { useSlots } from "vue";
+import { useDBGroupStore } from "@/store";
+import type { ComposedDatabaseGroup } from "@/types";
+
+interface DatabaseGroupSelectOption extends SelectOption {
+ value: string;
+ databaseGroup: ComposedDatabaseGroup;
+}
+
+const slots = useSlots();
+const props = withDefaults(
+ defineProps<{
+ value?: string;
+ project: string;
+ placeholder?: string;
+ }>(),
+ {
+ value: undefined,
+ project: undefined,
+ placeholder: undefined,
+ }
+);
+
+defineEmits<{
+ (event: "update:value", value: string | undefined): void;
+}>();
+
+const dbGroupStore = useDBGroupStore();
+
+const databaseGroupList = computed(() => {
+ return dbGroupStore.getDBGroupListByProjectName(props.project);
+});
+
+watch(
+ () => props.project,
+ async (project) =>
+ await dbGroupStore.getOrFetchDBGroupListByProjectName(project),
+ { immediate: true }
+);
+
+const filterByName = (pattern: string, option: SelectOption) => {
+ const { databaseGroup } = option as DatabaseGroupSelectOption;
+ return databaseGroup.databaseGroupName
+ .toLowerCase()
+ .includes(pattern.toLowerCase());
+};
+
+const options = computed(() => {
+ return databaseGroupList.value.map<DatabaseGroupSelectOption>(
+ (databaseGroup) => {
+ return {
+ databaseGroup,
+ value: databaseGroup.name,
+ label: databaseGroup.databaseGroupName,
+ };
+ }
+ );
+});
+
+const renderLabel: SelectRenderLabel = (option) => {
+ const { databaseGroup } = option as DatabaseGroupSelectOption;
+ if (!databaseGroup) {
+ return;
+ }
+
+ if (slots.default) {
+ return slots.default({ databaseGroup });
+ }
+
+ const children = [h("div", {}, [databaseGroup.databaseGroupName])];
+ return h(
+ "div",
+ {
+ class: "w-full flex flex-row justify-start items-center truncate",
+ },
+ children
+ );
+};
+</script>
diff --git a/frontend/src/components/v2/Select/index.ts b/frontend/src/components/v2/Select/index.ts
index 21d3647ef5..861e866859 100644
--- a/frontend/src/components/v2/Select/index.ts
+++ b/frontend/src/components/v2/Select/index.ts
@@ -1,4 +1,5 @@
import AnnouncementLevelSelect from "./AnnouncementLevelSelect.vue";
+import DatabaseGroupSelect from "./DatabaseGroupSelect.vue";
import DatabaseSelect from "./DatabaseSelect.vue";
import EnvironmentSelect from "./EnvironmentSelect.vue";
import InstanceSelect from "./InstanceSelect.vue";
@@ -10,6 +11,7 @@ export {
AnnouncementLevelSelect,
InstanceSelect,
DatabaseSelect,
+ DatabaseGroupSelect,
EnvironmentSelect,
ProjectSelect,
ProjectRoleSelect,
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 4df63b5acc..427509f263 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -3204,6 +3204,7 @@
},
"database-group": {
"self": "Database Group",
+ "select": "Select database group",
"create": "New database group",
"edit": "Edit database group",
"matched-database": "Matched database",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index e5c54c8d6f..0a77e2601e 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -3204,6 +3204,7 @@
},
"database-group": {
"self": "Grupo de Bases de Datos",
+ "select": "Seleccionar grupo de base de datos",
"create": "Crear grupo de bases de datos",
"edit": "Editar grupo de bases de datos",
"matched-database": "Base de datos coincidente",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 91058b3ef6..f3689bbda9 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -3204,6 +3204,7 @@
},
"database-group": {
"self": "データベースグループ",
+ "select": "データベースグループの選択",
"create": "新しいデータベースグループ",
"edit": "データベースグループを編集する",
"matched-database": "マッチしたデータベース",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 59569b6a9e..0537fec6e0 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -3204,6 +3204,7 @@
},
"database-group": {
"self": "Nhóm cơ sở dữ liệu",
+ "select": "Chọn nhóm cơ sở dữ liệu",
"create": "Nhóm cơ sở dữ liệu mới",
"edit": "Chỉnh sửa nhóm cơ sở dữ liệu",
"matched-database": "Cơ sở dữ liệu phù hợp",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index e5f1ab6d22..d2ceae18f0 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -3204,6 +3204,7 @@
},
"database-group": {
"self": "数据库分组",
+ "select": "选择数据库分组",
"create": "新建数据库分组",
"edit": "编辑数据库分组",
"matched-database": "相匹配的数据库",
diff --git a/frontend/src/types/proto/store/vcs.ts b/frontend/src/types/proto/store/vcs.ts
index 2151ce841e..189d500d19 100644
--- a/frontend/src/types/proto/store/vcs.ts
+++ b/frontend/src/types/proto/store/vcs.ts
@@ -33,6 +33,11 @@ export interface VCSConnector {
externalWebhookId: string;
/** For GitLab, webhook request contains this in the 'X-Gitlab-Token" header and we compare it with the one stored in db to validate it sends to the expected endpoint. */
webhookSecretToken: string;
+ /**
+ * Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+ * Format: projects/{project}/databaseGroups/{databaseGroup}
+ */
+ databaseGroup: string;
}
function createBaseVCSConnector(): VCSConnector {
@@ -45,6 +50,7 @@ function createBaseVCSConnector(): VCSConnector {
externalId: "",
externalWebhookId: "",
webhookSecretToken: "",
+ databaseGroup: "",
};
}
@@ -74,6 +80,9 @@ export const VCSConnector = {
if (message.webhookSecretToken !== "") {
writer.uint32(66).string(message.webhookSecretToken);
}
+ if (message.databaseGroup !== "") {
+ writer.uint32(74).string(message.databaseGroup);
+ }
return writer;
},
@@ -140,6 +149,13 @@ export const VCSConnector = {
message.webhookSecretToken = reader.string();
continue;
+ case 9:
+ if (tag !== 74) {
+ break;
+ }
+
+ message.databaseGroup = reader.string();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -159,6 +175,7 @@ export const VCSConnector = {
externalId: isSet(object.externalId) ? globalThis.String(object.externalId) : "",
externalWebhookId: isSet(object.externalWebhookId) ? globalThis.String(object.externalWebhookId) : "",
webhookSecretToken: isSet(object.webhookSecretToken) ? globalThis.String(object.webhookSecretToken) : "",
+ databaseGroup: isSet(object.databaseGroup) ? globalThis.String(object.databaseGroup) : "",
};
},
@@ -188,6 +205,9 @@ export const VCSConnector = {
if (message.webhookSecretToken !== "") {
obj.webhookSecretToken = message.webhookSecretToken;
}
+ if (message.databaseGroup !== "") {
+ obj.databaseGroup = message.databaseGroup;
+ }
return obj;
},
@@ -204,6 +224,7 @@ export const VCSConnector = {
message.externalId = object.externalId ?? "";
message.externalWebhookId = object.externalWebhookId ?? "";
message.webhookSecretToken = object.webhookSecretToken ?? "";
+ message.databaseGroup = object.databaseGroup ?? "";
return message;
},
};
diff --git a/frontend/src/types/proto/v1/vcs_connector_service.ts b/frontend/src/types/proto/v1/vcs_connector_service.ts
index 7a823b0fdd..3338466871 100644
--- a/frontend/src/types/proto/v1/vcs_connector_service.ts
+++ b/frontend/src/types/proto/v1/vcs_connector_service.ts
@@ -136,6 +136,11 @@ export interface VCSConnector {
fullPath: string;
/** The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. */
webUrl: string;
+ /**
+ * Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+ * Format: projects/{project}/databaseGroups/{databaseGroup}
+ */
+ databaseGroup: string;
}
function createBaseCreateVCSConnectorRequest(): CreateVCSConnectorRequest {
@@ -598,6 +603,7 @@ function createBaseVCSConnector(): VCSConnector {
branch: "",
fullPath: "",
webUrl: "",
+ databaseGroup: "",
};
}
@@ -639,6 +645,9 @@ export const VCSConnector = {
if (message.webUrl !== "") {
writer.uint32(106).string(message.webUrl);
}
+ if (message.databaseGroup !== "") {
+ writer.uint32(114).string(message.databaseGroup);
+ }
return writer;
},
@@ -733,6 +742,13 @@ export const VCSConnector = {
message.webUrl = reader.string();
continue;
+ case 14:
+ if (tag !== 114) {
+ break;
+ }
+
+ message.databaseGroup = reader.string();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -756,6 +772,7 @@ export const VCSConnector = {
branch: isSet(object.branch) ? globalThis.String(object.branch) : "",
fullPath: isSet(object.fullPath) ? globalThis.String(object.fullPath) : "",
webUrl: isSet(object.webUrl) ? globalThis.String(object.webUrl) : "",
+ databaseGroup: isSet(object.databaseGroup) ? globalThis.String(object.databaseGroup) : "",
};
},
@@ -797,6 +814,9 @@ export const VCSConnector = {
if (message.webUrl !== "") {
obj.webUrl = message.webUrl;
}
+ if (message.databaseGroup !== "") {
+ obj.databaseGroup = message.databaseGroup;
+ }
return obj;
},
@@ -817,6 +837,7 @@ export const VCSConnector = {
message.branch = object.branch ?? "";
message.fullPath = object.fullPath ?? "";
message.webUrl = object.webUrl ?? "";
+ message.databaseGroup = object.databaseGroup ?? "";
return message;
},
};
diff --git a/frontend/src/types/repository.ts b/frontend/src/types/repository.ts
index a37f712b64..a8a797f986 100644
--- a/frontend/src/types/repository.ts
+++ b/frontend/src/types/repository.ts
@@ -2,4 +2,5 @@ export type RepositoryConfig = {
baseDirectory: string;
branch: string;
resourceId: string;
+ databaseGroup: string;
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 056ce3410c..f9c24849bf 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -3539,6 +3539,7 @@ MFAConfig is the MFA configuration for a user.
| external_id | [string](#string) | | Repository id from the corresponding VCS provider. For GitLab, this is the project id. e.g. 123 |
| external_webhook_id | [string](#string) | | Push webhook id from the corresponding VCS provider. For GitLab, this is the project webhook id. e.g. 123 |
| webhook_secret_token | [string](#string) | | For GitLab, webhook request contains this in the &#39;X-Gitlab-Token&#34; header and we compare it with the one stored in db to validate it sends to the expected endpoint. |
+| database_group | [string](#string) | | Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project. Format: projects/{project}/databaseGroups/{databaseGroup} |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index c65c450513..17bec06fd7 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -8635,6 +8635,14 @@ For GitLab, this is the project webhook id. e.g. 123 </p></td>
<td><p>For GitLab, webhook request contains this in the &#39;X-Gitlab-Token&#34; header and we compare it with the one stored in db to validate it sends to the expected endpoint. </p></td>
</tr>
+ <tr>
+ <td>database_group</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+Format: projects/{project}/databaseGroups/{databaseGroup} </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index b6c78a507f..d728ca77da 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -9664,6 +9664,7 @@ The vcsConnector&#39;s `name` field is used to identify the vcsConnector to upda
| branch | [string](#string) | | The branch Bytebase listens to for changes. For example: main. |
| full_path | [string](#string) | | TODO(d): move these to create VCS connector API. The full_path of the repository. For example: bytebase/sample. |
| web_url | [string](#string) | | The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. |
+| database_group | [string](#string) | | Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project. Format: projects/{project}/databaseGroups/{databaseGroup} |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 335c3fba9e..ba6523964d 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -26647,6 +26647,14 @@ The full_path of the repository. For example: bytebase/sample. </p></td>
<td><p>The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample. </p></td>
</tr>
+ <tr>
+ <td>database_group</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+Format: projects/{project}/databaseGroups/{databaseGroup} </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/store/vcs.pb.go b/proto/generated-go/store/vcs.pb.go
index fa4decf357..4df64af583 100644
--- a/proto/generated-go/store/vcs.pb.go
+++ b/proto/generated-go/store/vcs.pb.go
@@ -45,6 +45,9 @@ type VCSConnector struct {
ExternalWebhookId string `protobuf:"bytes,7,opt,name=external_webhook_id,json=externalWebhookId,proto3" json:"external_webhook_id,omitempty"`
// For GitLab, webhook request contains this in the 'X-Gitlab-Token" header and we compare it with the one stored in db to validate it sends to the expected endpoint.
WebhookSecretToken string `protobuf:"bytes,8,opt,name=webhook_secret_token,json=webhookSecretToken,proto3" json:"webhook_secret_token,omitempty"`
+ // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+ // Format: projects/{project}/databaseGroups/{databaseGroup}
+ DatabaseGroup string `protobuf:"bytes,9,opt,name=database_group,json=databaseGroup,proto3" json:"database_group,omitempty"`
}
func (x *VCSConnector) Reset() {
@@ -135,12 +138,19 @@ func (x *VCSConnector) GetWebhookSecretToken() string {
return ""
}
+func (x *VCSConnector) GetDatabaseGroup() string {
+ if x != nil {
+ return x.DatabaseGroup
+ }
+ return ""
+}
+
var File_store_vcs_proto protoreflect.FileDescriptor
var file_store_vcs_proto_rawDesc = []byte{
0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
- 0x65, 0x22, 0x9c, 0x02, 0x0a, 0x0c, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
+ 0x65, 0x22, 0xc3, 0x02, 0x0a, 0x0c, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c,
0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c,
@@ -158,8 +168,11 @@ var file_store_vcs_proto_rawDesc = []byte{
0x0a, 0x14, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74,
0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x77, 0x65,
0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
- 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, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f,
+ 0x75, 0x70, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 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/generated-go/v1/vcs_connector_service.pb.go b/proto/generated-go/v1/vcs_connector_service.pb.go
index c6fb330eeb..f6d63ec451 100644
--- a/proto/generated-go/v1/vcs_connector_service.pb.go
+++ b/proto/generated-go/v1/vcs_connector_service.pb.go
@@ -421,6 +421,9 @@ type VCSConnector struct {
FullPath string `protobuf:"bytes,12,opt,name=full_path,json=fullPath,proto3" json:"full_path,omitempty"`
// The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.
WebUrl string `protobuf:"bytes,13,opt,name=web_url,json=webUrl,proto3" json:"web_url,omitempty"`
+ // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+ // Format: projects/{project}/databaseGroups/{databaseGroup}
+ DatabaseGroup string `protobuf:"bytes,14,opt,name=database_group,json=databaseGroup,proto3" json:"database_group,omitempty"`
}
func (x *VCSConnector) Reset() {
@@ -539,6 +542,13 @@ func (x *VCSConnector) GetWebUrl() string {
return ""
}
+func (x *VCSConnector) GetDatabaseGroup() string {
+ if x != nil {
+ return x.DatabaseGroup
+ }
+ return ""
+}
+
var File_v1_vcs_connector_service_proto protoreflect.FileDescriptor
var file_v1_vcs_connector_service_proto_rawDesc = []byte{
@@ -599,7 +609,7 @@ var file_v1_vcs_connector_service_proto_rawDesc = []byte{
0x4d, 0x61, 0x73, 0x6b, 0x22, 0x34, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x43,
0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xbb, 0x03, 0x0a, 0x0c, 0x56,
+ 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xe2, 0x03, 0x0a, 0x0c, 0x56,
0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41,
0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
@@ -627,60 +637,63 @@ var file_v1_vcs_connector_service_proto_rawDesc = []byte{
0x63, 0x68, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18,
0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12,
0x17, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x32, 0xb9, 0x06, 0x0a, 0x13, 0x56, 0x43, 0x53,
- 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
- 0x12, 0xab, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f,
- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43,
- 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43,
- 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x52, 0xda, 0x41, 0x13, 0x70,
- 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a, 0x0d, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f,
- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d,
- 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x87,
- 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f,
- 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x9a, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73,
- 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x25,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xda,
- 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25,
+ 0x52, 0x06, 0x77, 0x65, 0x62, 0x55, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0d, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x32,
+ 0xb9, 0x06, 0x0a, 0x13, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
+ 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xab, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x26,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f,
+ 0x72, 0x22, 0x52, 0xda, 0x41, 0x13, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x76, 0x63, 0x73,
+ 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x3a,
+ 0x0d, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x25,
0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
- 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xbf, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
- 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22,
- 0x66, 0xda, 0x41, 0x19, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f,
- 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x44, 0x3a, 0x0d, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x6f, 0x72, 0x32, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e,
- 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
- 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x26,
- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x34,
- 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
- 0x73, 0x2f, 0x2a, 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72,
- 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
- 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53,
+ 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f,
+ 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53,
+ 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x76,
+ 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12,
+ 0x9a, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
+ 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
+ 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56,
+ 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82,
+ 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x76,
+ 0x63, 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0xbf, 0x01, 0x0a,
+ 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
+ 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
+ 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x66, 0xda, 0x41, 0x19, 0x76, 0x63, 0x73, 0x5f, 0x63,
+ 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
+ 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x44, 0x3a, 0x0d, 0x76, 0x63, 0x73, 0x5f,
+ 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x32, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
+ 0x76, 0x63, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x76, 0x63,
+ 0x73, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a,
+ 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e, 0x6e,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x26, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x56, 0x43, 0x53, 0x43, 0x6f, 0x6e,
+ 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+ 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x76, 0x63, 0x73, 0x43, 0x6f,
+ 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/store/vcs.proto b/proto/store/vcs.proto
index 1e1f1e16d6..bcd97ae370 100644
--- a/proto/store/vcs.proto
+++ b/proto/store/vcs.proto
@@ -25,4 +25,7 @@ message VCSConnector {
string external_webhook_id = 7;
// For GitLab, webhook request contains this in the 'X-Gitlab-Token" header and we compare it with the one stored in db to validate it sends to the expected endpoint.
string webhook_secret_token = 8;
+ // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+ // Format: projects/{project}/databaseGroups/{databaseGroup}
+ string database_group = 9;
}
diff --git a/proto/v1/vcs_connector_service.proto b/proto/v1/vcs_connector_service.proto
index 27216d468f..909e6da78d 100644
--- a/proto/v1/vcs_connector_service.proto
+++ b/proto/v1/vcs_connector_service.proto
@@ -157,4 +157,8 @@ message VCSConnector {
// The web url of the repository. For axample: https://gitlab.bytebase.com/bytebase/sample.
string web_url = 13;
+
+ // Apply changes to the database group. Optional, if not set, will apply changes to all databases in the project.
+ // Format: projects/{project}/databaseGroups/{databaseGroup}
+ string database_group = 14;
}