Skip to content

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

chore: remove `version` from `changelist`.`change` (#16261)

boojackb90302154627
diff --git a/backend/api/v1/changelist_service.go b/backend/api/v1/changelist_service.go
index 745f874ccc..0dd0b1dd4b 100644
--- a/backend/api/v1/changelist_service.go
+++ b/backend/api/v1/changelist_service.go
@@ -255,9 +255,8 @@ func convertV1ChangelistPayload(changelist *v1pb.Changelist) *storepb.Changelist
}
for _, change := range changelist.Changes {
storeChangelist.Changes = append(storeChangelist.Changes, &storepb.Changelist_Change{
- Sheet: change.Sheet,
- Source: change.Source,
- Version: change.Version,
+ Sheet: change.Sheet,
+ Source: change.Source,
})
}
return storeChangelist
@@ -280,9 +279,8 @@ func (s *ChangelistService) convertStoreChangelist(ctx context.Context, changeli
}
for _, change := range changelist.Payload.Changes {
v1Changelist.Changes = append(v1Changelist.Changes, &v1pb.Changelist_Change{
- Sheet: change.Sheet,
- Source: change.Source,
- Version: change.Version,
+ Sheet: change.Sheet,
+ Source: change.Source,
})
}
return v1Changelist, nil
diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue
index 317f9b2f35..4ef74e9a04 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue
@@ -152,7 +152,6 @@ const doAddChange = async () => {
ChangelogView.CHANGELOG_VIEW_FULL
);
setSheetStatement(sheet, changelog?.statement || "");
- change.version = changelog?.version || "";
}
const created = await localSheetStore.saveLocalSheetToRemote(sheet);
change.sheet = created.name;
@@ -160,10 +159,7 @@ const doAddChange = async () => {
const sourceType = getChangelistChangeSourceType(change);
if (sourceType === "CHANGELOG") {
- const changelog = await useChangelogStore().getOrFetchChangelogByName(
- change.source
- );
- change.version = changelog?.version || "";
+ await useChangelogStore().getOrFetchChangelogByName(change.source);
}
return change;
};
diff --git a/frontend/src/components/Plan/logic/initialize/create.ts b/frontend/src/components/Plan/logic/initialize/create.ts
index b73c7dca69..4f66daff2b 100644
--- a/frontend/src/components/Plan/logic/initialize/create.ts
+++ b/frontend/src/components/Plan/logic/initialize/create.ts
@@ -101,8 +101,7 @@ const buildSpecs = async (
const buildSpecForTarget = async (
target: string,
{ project, query }: CreatePlanParams,
- sheetUID?: string,
- version?: string
+ sheetUID?: string
) => {
const sheet = `${project.name}/sheets/${sheetUID ?? nextUID()}`;
const template = query.template as IssueType | undefined;
@@ -141,9 +140,6 @@ const buildSpecForTarget = async (
spec.changeDatabaseConfig.sheet = remoteSheet.name;
}
}
- if (version) {
- spec.changeDatabaseConfig.schemaVersion = version;
- }
}
return spec;
};
@@ -165,12 +161,7 @@ const buildSpecsViaChangelist = async (
const sheetName = `${params.project.name}/sheets/${sheetUID}`;
const sheet = getLocalSheetByName(sheetName);
setSheetStatement(sheet, statement);
- const spec = await buildSpecForTarget(
- db,
- params,
- sheetUID,
- change.version
- );
+ const spec = await buildSpecForTarget(db, params, sheetUID);
specs.push(spec);
}
}
diff --git a/frontend/src/types/proto/v1/changelist_service.ts b/frontend/src/types/proto/v1/changelist_service.ts
index 979f4aff6a..638566e852 100644
--- a/frontend/src/types/proto/v1/changelist_service.ts
+++ b/frontend/src/types/proto/v1/changelist_service.ts
@@ -125,8 +125,6 @@ export interface Changelist_Change {
* 2) raw SQL if empty.
*/
source: string;
- /** The migration version for a change. */
- version: string;
}
function createBaseCreateChangelistRequest(): CreateChangelistRequest {
@@ -664,7 +662,7 @@ export const Changelist: MessageFns<Changelist> = {
};
function createBaseChangelist_Change(): Changelist_Change {
- return { sheet: "", source: "", version: "" };
+ return { sheet: "", source: "" };
}
export const Changelist_Change: MessageFns<Changelist_Change> = {
@@ -675,9 +673,6 @@ export const Changelist_Change: MessageFns<Changelist_Change> = {
if (message.source !== "") {
writer.uint32(18).string(message.source);
}
- if (message.version !== "") {
- writer.uint32(26).string(message.version);
- }
return writer;
},
@@ -704,14 +699,6 @@ export const Changelist_Change: MessageFns<Changelist_Change> = {
message.source = reader.string();
continue;
}
- case 3: {
- if (tag !== 26) {
- break;
- }
-
- message.version = reader.string();
- continue;
- }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -729,9 +716,6 @@ export const Changelist_Change: MessageFns<Changelist_Change> = {
if (message.source !== "") {
obj.source = message.source;
}
- if (message.version !== "") {
- obj.version = message.version;
- }
return obj;
},
@@ -742,7 +726,6 @@ export const Changelist_Change: MessageFns<Changelist_Change> = {
const message = createBaseChangelist_Change();
message.sheet = object.sheet ?? "";
message.source = object.source ?? "";
- message.version = object.version ?? "";
return message;
},
};
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 20e3bcbdfb..7a73ebfe41 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -8686,9 +8686,6 @@ components:
The source of origin.
1) changelog: instances/{instance}/databases/{database}/changelogs/{changelog}.
2) raw SQL if empty.
- version:
- type: string
- description: The migration version for a change.
Changelog:
type: object
properties:
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 400a37d858..695e1a9de9 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -809,7 +809,6 @@ Metadata about the request.
| ----- | ---- | ----- | ----------- |
| sheet | [string](#string) | | The name of a sheet. |
| source | [string](#string) | | The source of origin. 1) changes: instances/{instance}/databases/{database}/changelogs/{changelog}. 2) raw SQL if empty. |
-| version | [string](#string) | | The migration version for a change. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index be2564bc90..72ca99a18c 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -2631,13 +2631,6 @@ This information is not authenticated and should be treated accordingly. </p></t
2) raw SQL if empty. </p></td>
</tr>
- <tr>
- <td>version</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The migration version for a change. </p></td>
- </tr>
-
</tbody>
</table>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index cbb1fbb7c1..eddd4f8ac5 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -5888,7 +5888,6 @@ For example: - filter = &#34;method == &#39;/bytebase.v1.SQLService/Query&#39;&#
| ----- | ---- | ----- | ----------- |
| sheet | [string](#string) | | The name of a sheet. |
| source | [string](#string) | | The source of origin. 1) changelog: instances/{instance}/databases/{database}/changelogs/{changelog}. 2) raw SQL if empty. |
-| version | [string](#string) | | The migration version for a change. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 6cebd8653e..04295d342f 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -16705,13 +16705,6 @@ Format: users/{email} </p></td>
2) raw SQL if empty. </p></td>
</tr>
- <tr>
- <td>version</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>The migration version for a change. </p></td>
- </tr>
-
</tbody>
</table>
diff --git a/proto/generated-go/store/changelist.pb.go b/proto/generated-go/store/changelist.pb.go
index dcd539ccc1..6d9ca59d1c 100644
--- a/proto/generated-go/store/changelist.pb.go
+++ b/proto/generated-go/store/changelist.pb.go
@@ -80,9 +80,7 @@ type Changelist_Change struct {
// The source of origin.
// 1) changes: instances/{instance}/databases/{database}/changelogs/{changelog}.
// 2) raw SQL if empty.
- Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
- // The migration version for a change.
- Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
+ Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -131,26 +129,18 @@ func (x *Changelist_Change) GetSource() string {
return ""
}
-func (x *Changelist_Change) GetVersion() string {
- if x != nil {
- return x.Version
- }
- return ""
-}
-
var File_store_changelist_proto protoreflect.FileDescriptor
const file_store_changelist_proto_rawDesc = "" +
"\n" +
- "\x16store/changelist.proto\x12\x0ebytebase.store\"\xbd\x01\n" +
+ "\x16store/changelist.proto\x12\x0ebytebase.store\"\xa3\x01\n" +
"\n" +
"Changelist\x12 \n" +
"\vdescription\x18\x01 \x01(\tR\vdescription\x12;\n" +
- "\achanges\x18\x02 \x03(\v2!.bytebase.store.Changelist.ChangeR\achanges\x1aP\n" +
+ "\achanges\x18\x02 \x03(\v2!.bytebase.store.Changelist.ChangeR\achanges\x1a6\n" +
"\x06Change\x12\x14\n" +
"\x05sheet\x18\x01 \x01(\tR\x05sheet\x12\x16\n" +
- "\x06source\x18\x02 \x01(\tR\x06source\x12\x18\n" +
- "\aversion\x18\x03 \x01(\tR\aversionB\x14Z\x12generated-go/storeb\x06proto3"
+ "\x06source\x18\x02 \x01(\tR\x06sourceB\x14Z\x12generated-go/storeb\x06proto3"
var (
file_store_changelist_proto_rawDescOnce sync.Once
diff --git a/proto/generated-go/v1/changelist_service.pb.go b/proto/generated-go/v1/changelist_service.pb.go
index 8c4c8b9550..9651d85d97 100644
--- a/proto/generated-go/v1/changelist_service.pb.go
+++ b/proto/generated-go/v1/changelist_service.pb.go
@@ -459,9 +459,7 @@ type Changelist_Change struct {
// The source of origin.
// 1) changelog: instances/{instance}/databases/{database}/changelogs/{changelog}.
// 2) raw SQL if empty.
- Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
- // The migration version for a change.
- Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
+ Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -510,13 +508,6 @@ func (x *Changelist_Change) GetSource() string {
return ""
}
-func (x *Changelist_Change) GetVersion() string {
- if x != nil {
- return x.Version
- }
- return ""
-}
-
var File_v1_changelist_service_proto protoreflect.FileDescriptor
const file_v1_changelist_service_proto_rawDesc = "" +
@@ -549,7 +540,7 @@ const file_v1_changelist_service_proto_rawDesc = "" +
"updateMask\"O\n" +
"\x17DeleteChangelistRequest\x124\n" +
"\x04name\x18\x01 \x01(\tB \xe2A\x01\x02\xfaA\x19\n" +
- "\x17bytebase.com/ChangelistR\x04name\"\x83\x03\n" +
+ "\x17bytebase.com/ChangelistR\x04name\"\xe9\x02\n" +
"\n" +
"Changelist\x12\x19\n" +
"\x04name\x18\x01 \x01(\tB\x05\xe2A\x02\x02\x05R\x04name\x12 \n" +
@@ -557,11 +548,10 @@ const file_v1_changelist_service_proto_rawDesc = "" +
"\acreator\x18\x03 \x01(\tB\x04\xe2A\x01\x03R\acreator\x12A\n" +
"\vupdate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampB\x04\xe2A\x01\x03R\n" +
"updateTime\x128\n" +
- "\achanges\x18\a \x03(\v2\x1e.bytebase.v1.Changelist.ChangeR\achanges\x1aP\n" +
+ "\achanges\x18\a \x03(\v2\x1e.bytebase.v1.Changelist.ChangeR\achanges\x1a6\n" +
"\x06Change\x12\x14\n" +
"\x05sheet\x18\x01 \x01(\tR\x05sheet\x12\x16\n" +
- "\x06source\x18\x02 \x01(\tR\x06source\x12\x18\n" +
- "\aversion\x18\x03 \x01(\tR\aversion:I\xeaAF\n" +
+ "\x06source\x18\x02 \x01(\tR\x06source:I\xeaAF\n" +
"\x17bytebase.com/Changelist\x12+projects/{project}/changelists/{changelist}2\x8f\a\n" +
"\x11ChangelistService\x12\xbb\x01\n" +
"\x10CreateChangelist\x12$.bytebase.v1.CreateChangelistRequest\x1a\x17.bytebase.v1.Changelist\"h\xdaA\x11parent,changelist\x8a\xea0\x15bb.changelists.create\x90\xea0\x01\x82\xd3\xe4\x93\x021:\n" +
diff --git a/proto/store/store/changelist.proto b/proto/store/store/changelist.proto
index d5c41b2e14..9d5f2996a8 100644
--- a/proto/store/store/changelist.proto
+++ b/proto/store/store/changelist.proto
@@ -14,8 +14,6 @@ message Changelist {
// 1) changes: instances/{instance}/databases/{database}/changelogs/{changelog}.
// 2) raw SQL if empty.
string source = 2;
- // The migration version for a change.
- string version = 3;
}
repeated Change changes = 2;
}
diff --git a/proto/v1/v1/changelist_service.proto b/proto/v1/v1/changelist_service.proto
index 01ae4d90e9..f7aaffdb62 100644
--- a/proto/v1/v1/changelist_service.proto
+++ b/proto/v1/v1/changelist_service.proto
@@ -167,8 +167,6 @@ message Changelist {
// 1) changelog: instances/{instance}/databases/{database}/changelogs/{changelog}.
// 2) raw SQL if empty.
string source = 2;
- // The migration version for a change.
- string version = 3;
}
repeated Change changes = 7;
}