Skip to content

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

chore: add id to release file (#14235)

boojackf540755a9b10
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index 8ee04fac70..fd6a8bff71 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -1187,14 +1187,14 @@ func getSpecs(database *store.DatabaseMessage, revisions []*store.RevisionMessag
// applied, so we will not deploy it.
if r.Payload.SheetSha256 != file.SheetSha256 {
// It's been modified! warn users.
- modifiedFiles = append(modifiedFiles, common.FormatReleaseFile(releaseName, file.Name))
+ modifiedFiles = append(modifiedFiles, common.FormatReleaseFile(releaseName, file.Id))
}
continue
}
if lastVersion != "" && lastVersion >= file.Version {
// out of order detected
- outOfOrderFiles = append(outOfOrderFiles, common.FormatReleaseFile(releaseName, file.Name))
+ outOfOrderFiles = append(outOfOrderFiles, common.FormatReleaseFile(releaseName, file.Id))
// allowOutOfOrder=false
// continue so that we don't add it into the plan.
@@ -1206,7 +1206,7 @@ func getSpecs(database *store.DatabaseMessage, revisions []*store.RevisionMessag
spec := &v1pb.Plan_Spec{
Id: uuid.NewString(),
SpecReleaseSource: &v1pb.Plan_SpecReleaseSource{
- File: common.FormatReleaseFile(releaseName, file.Name),
+ File: common.FormatReleaseFile(releaseName, file.Id),
},
Config: &v1pb.Plan_Spec_ChangeDatabaseConfig{
ChangeDatabaseConfig: &v1pb.Plan_ChangeDatabaseConfig{
diff --git a/backend/api/v1/release_service.go b/backend/api/v1/release_service.go
index bbd46f5582..4243fdf903 100644
--- a/backend/api/v1/release_service.go
+++ b/backend/api/v1/release_service.go
@@ -3,6 +3,7 @@ package v1
import (
"context"
+ "github.com/google/uuid"
"github.com/pkg/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -52,6 +53,10 @@ func (s *ReleaseService) CreateRelease(ctx context.Context, request *v1pb.Create
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert files, err: %v", err)
}
+ // Generate UUID for each file.
+ for _, f := range files {
+ f.Id = uuid.NewString()
+ }
releaseMessage := &store.ReleaseMessage{
ProjectUID: project.UID,
@@ -287,6 +292,7 @@ func convertToReleaseFiles(ctx context.Context, s *store.Store, files []*storepb
return nil, errors.Errorf("sheet %q not found", f.Sheet)
}
v1Files = append(v1Files, &v1pb.Release_File{
+ Id: f.Id,
Name: f.Name,
Sheet: f.Sheet,
SheetSha256: f.SheetSha256,
@@ -331,6 +337,7 @@ func convertReleaseFiles(ctx context.Context, s *store.Store, files []*v1pb.Rele
}
rFiles = append(rFiles, &storepb.ReleasePayload_File{
+ Id: f.Id,
Name: f.Name,
Sheet: f.Sheet,
SheetSha256: sheet.Sha256,
diff --git a/backend/common/resource_name.go b/backend/common/resource_name.go
index 1e10e9ed56..49f55c57a1 100644
--- a/backend/common/resource_name.go
+++ b/backend/common/resource_name.go
@@ -714,11 +714,8 @@ func FormatReleaseName(projectID string, releaseUID int64) string {
return fmt.Sprintf("%s%s/%s%d", ProjectNamePrefix, projectID, ReleaseNamePrefix, releaseUID)
}
-// input release=`projects/{project}/releases/{release}` and file=`{path}`.
-// return the file resource name `projects/{project}/releases/{release}/files/{path}`,
-// {path} is URL path escaped.
-func FormatReleaseFile(release string, file string) string {
- return fmt.Sprintf("%s/%s%s", release, FileNamePrefix, url.PathEscape(file))
+func FormatReleaseFile(release string, fileID string) string {
+ return fmt.Sprintf("%s/%s%s", release, FileNamePrefix, fileID)
}
func FormatRevision(instanceID, databaseID string, revisionUID int64) string {
diff --git a/frontend/src/types/proto/store/release.ts b/frontend/src/types/proto/store/release.ts
index 4f7f8f2bd1..c741d9ebb9 100644
--- a/frontend/src/types/proto/store/release.ts
+++ b/frontend/src/types/proto/store/release.ts
@@ -63,6 +63,8 @@ export interface ReleasePayload {
}
export interface ReleasePayload_File {
+ /** The unique identifier for the file. */
+ id: string;
/**
* The name of the file.
* Expressed as a path, e.g. `2.2/V0001_create_table.sql`
@@ -178,25 +180,28 @@ export const ReleasePayload: MessageFns<ReleasePayload> = {
};
function createBaseReleasePayload_File(): ReleasePayload_File {
- return { name: "", sheet: "", sheetSha256: "", type: ReleaseFileType.TYPE_UNSPECIFIED, version: "" };
+ return { id: "", name: "", sheet: "", sheetSha256: "", type: ReleaseFileType.TYPE_UNSPECIFIED, version: "" };
}
export const ReleasePayload_File: MessageFns<ReleasePayload_File> = {
encode(message: ReleasePayload_File, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.id !== "") {
+ writer.uint32(10).string(message.id);
+ }
if (message.name !== "") {
- writer.uint32(10).string(message.name);
+ writer.uint32(18).string(message.name);
}
if (message.sheet !== "") {
- writer.uint32(18).string(message.sheet);
+ writer.uint32(26).string(message.sheet);
}
if (message.sheetSha256 !== "") {
- writer.uint32(26).string(message.sheetSha256);
+ writer.uint32(34).string(message.sheetSha256);
}
if (message.type !== ReleaseFileType.TYPE_UNSPECIFIED) {
- writer.uint32(32).int32(releaseFileTypeToNumber(message.type));
+ writer.uint32(40).int32(releaseFileTypeToNumber(message.type));
}
if (message.version !== "") {
- writer.uint32(42).string(message.version);
+ writer.uint32(50).string(message.version);
}
return writer;
},
@@ -213,31 +218,38 @@ export const ReleasePayload_File: MessageFns<ReleasePayload_File> = {
break;
}
- message.name = reader.string();
+ message.id = reader.string();
continue;
case 2:
if (tag !== 18) {
break;
}
- message.sheet = reader.string();
+ message.name = reader.string();
continue;
case 3:
if (tag !== 26) {
break;
}
- message.sheetSha256 = reader.string();
+ message.sheet = reader.string();
continue;
case 4:
- if (tag !== 32) {
+ if (tag !== 34) {
break;
}
- message.type = releaseFileTypeFromJSON(reader.int32());
+ message.sheetSha256 = reader.string();
continue;
case 5:
- if (tag !== 42) {
+ if (tag !== 40) {
+ break;
+ }
+
+ message.type = releaseFileTypeFromJSON(reader.int32());
+ continue;
+ case 6:
+ if (tag !== 50) {
break;
}
@@ -254,6 +266,7 @@ export const ReleasePayload_File: MessageFns<ReleasePayload_File> = {
fromJSON(object: any): ReleasePayload_File {
return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
name: isSet(object.name) ? globalThis.String(object.name) : "",
sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
sheetSha256: isSet(object.sheetSha256) ? globalThis.String(object.sheetSha256) : "",
@@ -264,6 +277,9 @@ export const ReleasePayload_File: MessageFns<ReleasePayload_File> = {
toJSON(message: ReleasePayload_File): unknown {
const obj: any = {};
+ if (message.id !== "") {
+ obj.id = message.id;
+ }
if (message.name !== "") {
obj.name = message.name;
}
@@ -287,6 +303,7 @@ export const ReleasePayload_File: MessageFns<ReleasePayload_File> = {
},
fromPartial(object: DeepPartial<ReleasePayload_File>): ReleasePayload_File {
const message = createBaseReleasePayload_File();
+ message.id = object.id ?? "";
message.name = object.name ?? "";
message.sheet = object.sheet ?? "";
message.sheetSha256 = object.sheetSha256 ?? "";
diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.ts
index ae7709df5c..f307c66e10 100644
--- a/frontend/src/types/proto/v1/plan_service.ts
+++ b/frontend/src/types/proto/v1/plan_service.ts
@@ -488,11 +488,7 @@ export interface PreviewPlanResponse {
export interface PreviewPlanResponse_DatabaseFiles {
database: string;
- /**
- * Format: projects/{project}/releases/{release}/files/{path}
- * {path} is URL path escaped.
- * Example: `projects/tnt/releases/0801/files/2.2%2FV0001_create_table.sql`
- */
+ /** Format: projects/{project}/releases/{release}/files/{file_id} */
files: string[];
}
diff --git a/frontend/src/types/proto/v1/release_service.ts b/frontend/src/types/proto/v1/release_service.ts
index 891651553d..c6a4889ea8 100644
--- a/frontend/src/types/proto/v1/release_service.ts
+++ b/frontend/src/types/proto/v1/release_service.ts
@@ -150,6 +150,8 @@ export interface Release {
}
export interface Release_File {
+ /** The unique identifier for the file. */
+ id: string;
/**
* The name of the file.
* Expressed as a path, e.g. `2.2/V0001_create_table.sql`
@@ -838,6 +840,7 @@ export const Release: MessageFns<Release> = {
function createBaseRelease_File(): Release_File {
return {
+ id: "",
name: "",
sheet: "",
sheetSha256: "",
@@ -850,26 +853,29 @@ function createBaseRelease_File(): Release_File {
export const Release_File: MessageFns<Release_File> = {
encode(message: Release_File, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.id !== "") {
+ writer.uint32(10).string(message.id);
+ }
if (message.name !== "") {
- writer.uint32(10).string(message.name);
+ writer.uint32(18).string(message.name);
}
if (message.sheet !== "") {
- writer.uint32(18).string(message.sheet);
+ writer.uint32(26).string(message.sheet);
}
if (message.sheetSha256 !== "") {
- writer.uint32(26).string(message.sheetSha256);
+ writer.uint32(34).string(message.sheetSha256);
}
if (message.type !== ReleaseFileType.TYPE_UNSPECIFIED) {
- writer.uint32(32).int32(releaseFileTypeToNumber(message.type));
+ writer.uint32(40).int32(releaseFileTypeToNumber(message.type));
}
if (message.version !== "") {
- writer.uint32(42).string(message.version);
+ writer.uint32(50).string(message.version);
}
if (message.statement !== "") {
- writer.uint32(50).string(message.statement);
+ writer.uint32(58).string(message.statement);
}
if (!message.statementSize.equals(Long.ZERO)) {
- writer.uint32(56).int64(message.statementSize.toString());
+ writer.uint32(64).int64(message.statementSize.toString());
}
return writer;
},
@@ -886,45 +892,52 @@ export const Release_File: MessageFns<Release_File> = {
break;
}
- message.name = reader.string();
+ message.id = reader.string();
continue;
case 2:
if (tag !== 18) {
break;
}
- message.sheet = reader.string();
+ message.name = reader.string();
continue;
case 3:
if (tag !== 26) {
break;
}
- message.sheetSha256 = reader.string();
+ message.sheet = reader.string();
continue;
case 4:
- if (tag !== 32) {
+ if (tag !== 34) {
break;
}
- message.type = releaseFileTypeFromJSON(reader.int32());
+ message.sheetSha256 = reader.string();
continue;
case 5:
- if (tag !== 42) {
+ if (tag !== 40) {
break;
}
- message.version = reader.string();
+ message.type = releaseFileTypeFromJSON(reader.int32());
continue;
case 6:
if (tag !== 50) {
break;
}
- message.statement = reader.string();
+ message.version = reader.string();
continue;
case 7:
- if (tag !== 56) {
+ if (tag !== 58) {
+ break;
+ }
+
+ message.statement = reader.string();
+ continue;
+ case 8:
+ if (tag !== 64) {
break;
}
@@ -941,6 +954,7 @@ export const Release_File: MessageFns<Release_File> = {
fromJSON(object: any): Release_File {
return {
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
name: isSet(object.name) ? globalThis.String(object.name) : "",
sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
sheetSha256: isSet(object.sheetSha256) ? globalThis.String(object.sheetSha256) : "",
@@ -953,6 +967,9 @@ export const Release_File: MessageFns<Release_File> = {
toJSON(message: Release_File): unknown {
const obj: any = {};
+ if (message.id !== "") {
+ obj.id = message.id;
+ }
if (message.name !== "") {
obj.name = message.name;
}
@@ -982,6 +999,7 @@ export const Release_File: MessageFns<Release_File> = {
},
fromPartial(object: DeepPartial<Release_File>): Release_File {
const message = createBaseRelease_File();
+ message.id = object.id ?? "";
message.name = object.name ?? "";
message.sheet = object.sheet ?? "";
message.sheetSha256 = object.sheetSha256 ?? "";
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 705d3b2b97..dd9d960b65 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -12302,10 +12302,7 @@ components:
type: array
items:
type: string
- description: |-
- Format: projects/{project}/releases/{release}/files/{path}
- {path} is URL path escaped.
- Example: `projects/tnt/releases/0801/files/2.2%2FV0001_create_table.sql`
+ description: 'Format: projects/{project}/releases/{release}/files/{file_id}'
PreviewRolloutRequest:
required:
- project
@@ -12671,6 +12668,10 @@ components:
Release_File:
type: object
properties:
+ id:
+ readOnly: true
+ type: string
+ description: The unique identifier for the file.
name:
type: string
description: |-
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index f68d0e8288..0094e51eb2 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -3664,6 +3664,7 @@ SlowQueryPolicy is the policy configuration for slow query.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
+| id | [string](#string) | | The unique identifier for the file. |
| name | [string](#string) | | The name of the file. Expressed as a path, e.g. `2.2/V0001_create_table.sql` |
| sheet | [string](#string) | | The sheet that holds the content. Format: projects/{project}/sheets/{sheet} |
| sheet_sha256 | [string](#string) | | The SHA256 hash value of the sheet. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index add03cb6cd..ef01efbbf2 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -9327,6 +9327,13 @@ IM integration setting should be set for this function to work. </p></td>
</thead>
<tbody>
+ <tr>
+ <td>id</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The unique identifier for the file. </p></td>
+ </tr>
+
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index d786ec4b9d..7a388606d8 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -1704,6 +1704,7 @@ When paginating, all other parameters provided to `ListReleasesRequest` must mat
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
+| id | [string](#string) | | The unique identifier for the file. |
| name | [string](#string) | | The name of the file. Expressed as a path, e.g. `2.2/V0001_create_table.sql` |
| sheet | [string](#string) | | The sheet that holds the content. Format: projects/{project}/sheets/{sheet} |
| sheet_sha256 | [string](#string) | | The SHA256 hash value of the sheet. |
@@ -8459,7 +8460,7 @@ When paginating, all other parameters provided to `ListPlans` must match the cal
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| database | [string](#string) | | |
-| files | [string](#string) | repeated | Format: projects/{project}/releases/{release}/files/{path} {path} is URL path escaped. Example: `projects/tnt/releases/0801/files/2.2%2FV0001_create_table.sql` |
+| files | [string](#string) | repeated | Format: projects/{project}/releases/{release}/files/{file_id} |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 4c66c04696..9239b6df4e 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -5610,6 +5610,13 @@ If this field is omitted, there are no subsequent pages. </p></td>
</thead>
<tbody>
+ <tr>
+ <td>id</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The unique identifier for the file. </p></td>
+ </tr>
+
<tr>
<td>name</td>
<td><a href="#string">string</a></td>
@@ -23475,9 +23482,7 @@ instances/{instance}/databases/{database} </p></td>
<td>files</td>
<td><a href="#string">string</a></td>
<td>repeated</td>
- <td><p>Format: projects/{project}/releases/{release}/files/{path}
-{path} is URL path escaped.
-Example: `projects/tnt/releases/0801/files/2.2%2FV0001_create_table.sql` </p></td>
+ <td><p>Format: projects/{project}/releases/{release}/files/{file_id} </p></td>
</tr>
</tbody>
diff --git a/proto/generated-go/store/release.pb.go b/proto/generated-go/store/release.pb.go
index 22599c2f2a..59d625bf55 100644
--- a/proto/generated-go/store/release.pb.go
+++ b/proto/generated-go/store/release.pb.go
@@ -133,16 +133,18 @@ type ReleasePayload_File struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
+ // The unique identifier for the file.
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// The name of the file.
// Expressed as a path, e.g. `2.2/V0001_create_table.sql`
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// The sheet that holds the content.
// Format: projects/{project}/sheets/{sheet}
- Sheet string `protobuf:"bytes,2,opt,name=sheet,proto3" json:"sheet,omitempty"`
+ Sheet string `protobuf:"bytes,3,opt,name=sheet,proto3" json:"sheet,omitempty"`
// The SHA256 hash value of the sheet.
- SheetSha256 string `protobuf:"bytes,3,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`
- Type ReleaseFileType `protobuf:"varint,4,opt,name=type,proto3,enum=bytebase.store.ReleaseFileType" json:"type,omitempty"`
- Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
+ SheetSha256 string `protobuf:"bytes,4,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`
+ Type ReleaseFileType `protobuf:"varint,5,opt,name=type,proto3,enum=bytebase.store.ReleaseFileType" json:"type,omitempty"`
+ Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
}
func (x *ReleasePayload_File) Reset() {
@@ -175,6 +177,13 @@ func (*ReleasePayload_File) Descriptor() ([]byte, []int) {
return file_store_release_proto_rawDescGZIP(), []int{0, 0}
}
+func (x *ReleasePayload_File) GetId() string {
+ if x != nil {
+ return x.Id
+ }
+ return ""
+}
+
func (x *ReleasePayload_File) GetName() string {
if x != nil {
return x.Name
@@ -271,7 +280,7 @@ var file_store_release_proto_rawDesc = []byte{
0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd3, 0x03, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe3, 0x03, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x39, 0x0a,
0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62,
@@ -282,18 +291,19 @@ var file_store_release_proto_rawDesc = []byte{
0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x65,
0x6c, 0x65, 0x61, 0x73, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x56, 0x43, 0x53,
0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x76, 0x63, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63,
- 0x65, 0x1a, 0xbb, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d,
- 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xfa,
+ 0x65, 0x1a, 0xcb, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d,
+ 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xfa,
0x41, 0x14, 0x0a, 0x12, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x21, 0x0a,
- 0x0c, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20,
+ 0x0c, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36,
- 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f,
+ 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f,
0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a,
+ 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a,
0x69, 0x0a, 0x09, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x0a, 0x08,
0x76, 0x63, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17,
0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
diff --git a/proto/generated-go/v1/plan_service.pb.go b/proto/generated-go/v1/plan_service.pb.go
index 7b1f4291ed..bc5d6581b1 100644
--- a/proto/generated-go/v1/plan_service.pb.go
+++ b/proto/generated-go/v1/plan_service.pb.go
@@ -2060,9 +2060,7 @@ type PreviewPlanResponse_DatabaseFiles struct {
unknownFields protoimpl.UnknownFields
Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
- // Format: projects/{project}/releases/{release}/files/{path}
- // {path} is URL path escaped.
- // Example: `projects/tnt/releases/0801/files/2.2%2FV0001_create_table.sql`
+ // Format: projects/{project}/releases/{release}/files/{file_id}
Files []string `protobuf:"bytes,2,rep,name=files,proto3" json:"files,omitempty"`
}
diff --git a/proto/generated-go/v1/release_service.pb.go b/proto/generated-go/v1/release_service.pb.go
index 8b7453393b..c461b6c97f 100644
--- a/proto/generated-go/v1/release_service.pb.go
+++ b/proto/generated-go/v1/release_service.pb.go
@@ -554,19 +554,21 @@ type Release_File struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
+ // The unique identifier for the file.
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// The name of the file.
// Expressed as a path, e.g. `2.2/V0001_create_table.sql`
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
// The sheet that holds the content.
// Format: projects/{project}/sheets/{sheet}
- Sheet string `protobuf:"bytes,2,opt,name=sheet,proto3" json:"sheet,omitempty"`
+ Sheet string `protobuf:"bytes,3,opt,name=sheet,proto3" json:"sheet,omitempty"`
// The SHA256 hash value of the sheet.
- SheetSha256 string `protobuf:"bytes,3,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`
- Type ReleaseFileType `protobuf:"varint,4,opt,name=type,proto3,enum=bytebase.v1.ReleaseFileType" json:"type,omitempty"`
- Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
+ SheetSha256 string `protobuf:"bytes,4,opt,name=sheet_sha256,json=sheetSha256,proto3" json:"sheet_sha256,omitempty"`
+ Type ReleaseFileType `protobuf:"varint,5,opt,name=type,proto3,enum=bytebase.v1.ReleaseFileType" json:"type,omitempty"`
+ Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
// The statement is used for preview purpose.
- Statement string `protobuf:"bytes,6,opt,name=statement,proto3" json:"statement,omitempty"`
- StatementSize int64 `protobuf:"varint,7,opt,name=statement_size,json=statementSize,proto3" json:"statement_size,omitempty"`
+ Statement string `protobuf:"bytes,7,opt,name=statement,proto3" json:"statement,omitempty"`
+ StatementSize int64 `protobuf:"varint,8,opt,name=statement_size,json=statementSize,proto3" json:"statement_size,omitempty"`
}
func (x *Release_File) Reset() {
@@ -599,6 +601,13 @@ func (*Release_File) Descriptor() ([]byte, []int) {
return file_v1_release_service_proto_rawDescGZIP(), []int{7, 0}
}
+func (x *Release_File) GetId() string {
+ if x != nil {
+ return x.Id
+ }
+ return ""
+}
+
func (x *Release_File) GetName() string {
if x != nil {
return x.Name
@@ -769,7 +778,7 @@ var file_v1_release_service_proto_rawDesc = []byte{
0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41,
0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
- 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xec, 0x05,
+ 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x82, 0x06,
0x0a, 0x07, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69,
@@ -789,91 +798,92 @@ var file_v1_release_service_proto_rawDesc = []byte{
0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18,
0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
- 0x1a, 0x8f, 0x02, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a,
- 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xfa, 0x41,
- 0x14, 0x0a, 0x12, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
- 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0c,
- 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x53,
- 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70,
- 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
- 0x6e, 0x12, 0x22, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74,
- 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65,
- 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x42, 0x04, 0xe2,
- 0x41, 0x01, 0x03, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x69,
- 0x7a, 0x65, 0x1a, 0x66, 0x0a, 0x09, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
- 0x2f, 0x0a, 0x08, 0x76, 0x63, 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x56, 0x43, 0x53, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x76, 0x63, 0x73, 0x54, 0x79, 0x70, 0x65,
- 0x12, 0x28, 0x0a, 0x10, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x6c, 0x6c,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x72, 0x6c, 0x3a, 0x40, 0xea, 0x41, 0x3d, 0x0a,
- 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x65,
- 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x25, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
- 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,
- 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x7d, 0x2a, 0x36, 0x0a, 0x0f,
- 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 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, 0x0d, 0x0a, 0x09, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e,
- 0x45, 0x44, 0x10, 0x01, 0x32, 0xb7, 0x06, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65,
- 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
- 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x86, 0x01, 0x0a,
- 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
- 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,
- 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x31, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
- 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c,
- 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x1a, 0xa5, 0x02, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x02, 0x69, 0x64, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12,
+ 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x17, 0xfa, 0x41, 0x14, 0x0a, 0x12, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x05, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0c, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x32,
+ 0x35, 0x36, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0b,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x30, 0x0a, 0x04, 0x74,
+ 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46,
+ 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a,
+ 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03,
+ 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x73,
+ 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20,
+ 0x01, 0x28, 0x03, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x66, 0x0a, 0x09, 0x56, 0x43, 0x53, 0x53,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x76, 0x63, 0x73, 0x5f, 0x74, 0x79, 0x70,
+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x76,
+ 0x63, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0e, 0x70, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x55, 0x72, 0x6c,
+ 0x3a, 0x40, 0xea, 0x41, 0x3d, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x25, 0x70, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x7d, 0x2a, 0x36, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c,
+ 0x65, 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, 0x0d, 0x0a, 0x09, 0x56,
+ 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x32, 0xb7, 0x06, 0x0a, 0x0e, 0x52,
+ 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a,
+ 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22,
+ 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f,
+ 0x2a, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61,
+ 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
+ 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x0d,
+ 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52,
+ 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x42, 0xda, 0x41, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x2c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a,
+ 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
+ 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x0d, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,
+ 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x13, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x33, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x32, 0x28, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61,
+ 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x7b, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x22, 0x42, 0xda, 0x41, 0x0e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
- 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x73, 0x12, 0x99, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52,
- 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22,
- 0x4f, 0xda, 0x41, 0x13, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61,
- 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x07, 0x72,
- 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x32, 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x6c,
- 0x65, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
- 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d,
- 0x12, 0x7b, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
- 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 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, 0x2f, 0xda, 0x41,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31,
- 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f,
- 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x7f, 0x0a,
- 0x0f, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,
- 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,
- 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,
- 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 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,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65,
+ 0x61, 0x73, 0x65, 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, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x22, 0x2a, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x12, 0x7f, 0x0a, 0x0f, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52,
+ 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x22, 0x31, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x22, 0x29, 0x2f, 0x76, 0x31, 0x2f, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f,
+ 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 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/release.proto b/proto/store/release.proto
index ca8f8e8828..0aff70e60b 100644
--- a/proto/store/release.proto
+++ b/proto/store/release.proto
@@ -15,16 +15,18 @@ message ReleasePayload {
VCSSource vcs_source = 3;
message File {
+ // The unique identifier for the file.
+ string id = 1;
// The name of the file.
// Expressed as a path, e.g. `2.2/V0001_create_table.sql`
- string name = 1;
+ string name = 2;
// The sheet that holds the content.
// Format: projects/{project}/sheets/{sheet}
- string sheet = 2 [(google.api.resource_reference) = {type: "bytebase.com/Sheet"}];
+ string sheet = 3 [(google.api.resource_reference) = {type: "bytebase.com/Sheet"}];
// The SHA256 hash value of the sheet.
- string sheet_sha256 = 3;
- ReleaseFileType type = 4;
- string version = 5;
+ string sheet_sha256 = 4;
+ ReleaseFileType type = 5;
+ string version = 6;
}
message VCSSource {
diff --git a/proto/v1/plan_service.proto b/proto/v1/plan_service.proto
index bd3df0ccf2..367b8cfc54 100644
--- a/proto/v1/plan_service.proto
+++ b/proto/v1/plan_service.proto
@@ -451,9 +451,7 @@ message PreviewPlanResponse {
message DatabaseFiles {
string database = 1;
- // Format: projects/{project}/releases/{release}/files/{path}
- // {path} is URL path escaped.
- // Example: `projects/tnt/releases/0801/files/2.2%2FV0001_create_table.sql`
+ // Format: projects/{project}/releases/{release}/files/{file_id}
repeated string files = 2;
}
}
diff --git a/proto/v1/release_service.proto b/proto/v1/release_service.proto
index f2bd54db8b..f943a104e2 100644
--- a/proto/v1/release_service.proto
+++ b/proto/v1/release_service.proto
@@ -144,20 +144,22 @@ message Release {
State state = 7;
message File {
+ // The unique identifier for the file.
+ string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// The name of the file.
// Expressed as a path, e.g. `2.2/V0001_create_table.sql`
- string name = 1;
+ string name = 2;
// The sheet that holds the content.
// Format: projects/{project}/sheets/{sheet}
- string sheet = 2 [(google.api.resource_reference) = {type: "bytebase.com/Sheet"}];
+ string sheet = 3 [(google.api.resource_reference) = {type: "bytebase.com/Sheet"}];
// The SHA256 hash value of the sheet.
- string sheet_sha256 = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
- ReleaseFileType type = 4;
- string version = 5;
+ string sheet_sha256 = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
+ ReleaseFileType type = 5;
+ string version = 6;
// The statement is used for preview purpose.
- string statement = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
- int64 statement_size = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+ string statement = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+ int64 statement_size = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
}
message VCSSource {