Skip to content

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

chore: drifted proto (#15800)

Danny Xud49fe698d75f
diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.ts
index 2fdf22f5e2..1576d9993b 100644
--- a/frontend/src/types/proto/google/protobuf/descriptor.ts
+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts
@@ -210,11 +210,19 @@ export interface FileDescriptorProto {
* The supported values are "proto2", "proto3", and "editions".
*
* If `edition` is present, this value must be "editions".
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
*/
syntax?:
| string
| undefined;
- /** The edition of the proto file. */
+ /**
+ * The edition of the proto file.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
edition?: Edition | undefined;
}
@@ -931,7 +939,12 @@ export interface FileOptions {
rubyPackage?:
| string
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1083,7 +1096,12 @@ export interface MessageOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1188,7 +1206,12 @@ export interface FieldOptions {
retention?: FieldOptions_OptionRetention | undefined;
targets: FieldOptions_OptionTargetType[];
editionDefaults: FieldOptions_EditionDefault[];
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?: FeatureSet | undefined;
featureSupport?:
| FieldOptions_FeatureSupport
@@ -1524,7 +1547,12 @@ export interface FieldOptions_FeatureSupport {
}
export interface OneofOptions {
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1562,7 +1590,12 @@ export interface EnumOptions {
deprecatedLegacyJsonFieldConflicts?:
| boolean
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1580,7 +1613,12 @@ export interface EnumValueOptions {
deprecated?:
| boolean
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1601,7 +1639,12 @@ export interface EnumValueOptions {
}
export interface ServiceOptions {
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1629,7 +1672,12 @@ export interface MethodOptions {
idempotencyLevel?:
| MethodOptions_IdempotencyLevel
| undefined;
- /** Any features defined in the specific edition. */
+ /**
+ * Any features defined in the specific edition.
+ * WARNING: This field should only be used by protobuf plugins or special
+ * cases like the proto compiler. Other uses are discouraged and
+ * developers should rely on the protoreflect APIs for their client language.
+ */
features?:
| FeatureSet
| undefined;
@@ -1746,6 +1794,7 @@ export interface FeatureSet {
utf8Validation?: FeatureSet_Utf8Validation | undefined;
messageEncoding?: FeatureSet_MessageEncoding | undefined;
jsonFormat?: FeatureSet_JsonFormat | undefined;
+ enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined;
}
export enum FeatureSet_FieldPresence {
@@ -2074,6 +2123,59 @@ export function featureSet_JsonFormatToNumber(object: FeatureSet_JsonFormat): nu
}
}
+export enum FeatureSet_EnforceNamingStyle {
+ ENFORCE_NAMING_STYLE_UNKNOWN = "ENFORCE_NAMING_STYLE_UNKNOWN",
+ STYLE2024 = "STYLE2024",
+ STYLE_LEGACY = "STYLE_LEGACY",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle {
+ switch (object) {
+ case 0:
+ case "ENFORCE_NAMING_STYLE_UNKNOWN":
+ return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
+ case 1:
+ case "STYLE2024":
+ return FeatureSet_EnforceNamingStyle.STYLE2024;
+ case 2:
+ case "STYLE_LEGACY":
+ return FeatureSet_EnforceNamingStyle.STYLE_LEGACY;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return FeatureSet_EnforceNamingStyle.UNRECOGNIZED;
+ }
+}
+
+export function featureSet_EnforceNamingStyleToJSON(object: FeatureSet_EnforceNamingStyle): string {
+ switch (object) {
+ case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
+ return "ENFORCE_NAMING_STYLE_UNKNOWN";
+ case FeatureSet_EnforceNamingStyle.STYLE2024:
+ return "STYLE2024";
+ case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
+ return "STYLE_LEGACY";
+ case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function featureSet_EnforceNamingStyleToNumber(object: FeatureSet_EnforceNamingStyle): number {
+ switch (object) {
+ case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN:
+ return 0;
+ case FeatureSet_EnforceNamingStyle.STYLE2024:
+ return 1;
+ case FeatureSet_EnforceNamingStyle.STYLE_LEGACY:
+ return 2;
+ case FeatureSet_EnforceNamingStyle.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/**
* A compiled specification for the defaults of a set of features. These
* messages are generated from FeatureSet extensions and can be used to seed
@@ -6160,6 +6262,7 @@ function createBaseFeatureSet(): FeatureSet {
utf8Validation: FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN,
messageEncoding: FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN,
jsonFormat: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
+ enforceNamingStyle: FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
};
}
@@ -6194,6 +6297,12 @@ export const FeatureSet: MessageFns<FeatureSet> = {
if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
writer.uint32(48).int32(featureSet_JsonFormatToNumber(message.jsonFormat));
}
+ if (
+ message.enforceNamingStyle !== undefined &&
+ message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
+ ) {
+ writer.uint32(56).int32(featureSet_EnforceNamingStyleToNumber(message.enforceNamingStyle));
+ }
return writer;
},
@@ -6252,6 +6361,14 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.jsonFormat = featureSet_JsonFormatFromJSON(reader.int32());
continue;
}
+ case 7: {
+ if (tag !== 56) {
+ break;
+ }
+
+ message.enforceNamingStyle = featureSet_EnforceNamingStyleFromJSON(reader.int32());
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -6281,6 +6398,9 @@ export const FeatureSet: MessageFns<FeatureSet> = {
jsonFormat: isSet(object.jsonFormat)
? featureSet_JsonFormatFromJSON(object.jsonFormat)
: FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN,
+ enforceNamingStyle: isSet(object.enforceNamingStyle)
+ ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle)
+ : FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN,
};
},
@@ -6315,6 +6435,12 @@ export const FeatureSet: MessageFns<FeatureSet> = {
if (message.jsonFormat !== undefined && message.jsonFormat !== FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN) {
obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat);
}
+ if (
+ message.enforceNamingStyle !== undefined &&
+ message.enforceNamingStyle !== FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN
+ ) {
+ obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle);
+ }
return obj;
},
@@ -6330,6 +6456,8 @@ export const FeatureSet: MessageFns<FeatureSet> = {
message.utf8Validation = object.utf8Validation ?? FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;
message.messageEncoding = object.messageEncoding ?? FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN;
message.jsonFormat = object.jsonFormat ?? FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN;
+ message.enforceNamingStyle = object.enforceNamingStyle ??
+ FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN;
return message;
},
};
diff --git a/frontend/src/types/proto/google/protobuf/wrappers.ts b/frontend/src/types/proto/google/protobuf/wrappers.ts
index 07224c0f85..bb730b69e5 100644
--- a/frontend/src/types/proto/google/protobuf/wrappers.ts
+++ b/frontend/src/types/proto/google/protobuf/wrappers.ts
@@ -14,6 +14,9 @@ export const protobufPackage = "google.protobuf";
* Wrapper message for `double`.
*
* The JSON representation for `DoubleValue` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface DoubleValue {
/** The double value. */
@@ -24,6 +27,9 @@ export interface DoubleValue {
* Wrapper message for `float`.
*
* The JSON representation for `FloatValue` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface FloatValue {
/** The float value. */
@@ -34,6 +40,9 @@ export interface FloatValue {
* Wrapper message for `int64`.
*
* The JSON representation for `Int64Value` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface Int64Value {
/** The int64 value. */
@@ -44,6 +53,9 @@ export interface Int64Value {
* Wrapper message for `uint64`.
*
* The JSON representation for `UInt64Value` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface UInt64Value {
/** The uint64 value. */
@@ -54,6 +66,9 @@ export interface UInt64Value {
* Wrapper message for `int32`.
*
* The JSON representation for `Int32Value` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface Int32Value {
/** The int32 value. */
@@ -64,6 +79,9 @@ export interface Int32Value {
* Wrapper message for `uint32`.
*
* The JSON representation for `UInt32Value` is JSON number.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface UInt32Value {
/** The uint32 value. */
@@ -74,6 +92,9 @@ export interface UInt32Value {
* Wrapper message for `bool`.
*
* The JSON representation for `BoolValue` is JSON `true` and `false`.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface BoolValue {
/** The bool value. */
@@ -84,6 +105,9 @@ export interface BoolValue {
* Wrapper message for `string`.
*
* The JSON representation for `StringValue` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface StringValue {
/** The string value. */
@@ -94,6 +118,9 @@ export interface StringValue {
* Wrapper message for `bytes`.
*
* The JSON representation for `BytesValue` is JSON string.
+ *
+ * Not recommended for use in new APIs, but still useful for legacy APIs and
+ * has no plan to be removed.
*/
export interface BytesValue {
/** The bytes value. */
diff --git a/frontend/src/types/proto/store/database.ts b/frontend/src/types/proto/store/database.ts
index bf4b633f9a..a3505b1294 100644
--- a/frontend/src/types/proto/store/database.ts
+++ b/frontend/src/types/proto/store/database.ts
@@ -20,6 +20,8 @@ export interface DatabaseMetadata {
backupAvailable: boolean;
datashare: boolean;
secrets: Secret[];
+ /** The schema is drifted from the source of truth. */
+ drifted: boolean;
}
export interface DatabaseMetadata_LabelsEntry {
@@ -1097,7 +1099,7 @@ export interface ObjectSchema_ArrayKind {
}
function createBaseDatabaseMetadata(): DatabaseMetadata {
- return { labels: {}, lastSyncTime: undefined, backupAvailable: false, datashare: false, secrets: [] };
+ return { labels: {}, lastSyncTime: undefined, backupAvailable: false, datashare: false, secrets: [], drifted: false };
}
export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
@@ -1117,6 +1119,9 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
for (const v of message.secrets) {
Secret.encode(v!, writer.uint32(42).fork()).join();
}
+ if (message.drifted !== false) {
+ writer.uint32(48).bool(message.drifted);
+ }
return writer;
},
@@ -1170,6 +1175,14 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
message.secrets.push(Secret.decode(reader, reader.uint32()));
continue;
}
+ case 6: {
+ if (tag !== 48) {
+ break;
+ }
+
+ message.drifted = reader.bool();
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1191,6 +1204,7 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
backupAvailable: isSet(object.backupAvailable) ? globalThis.Boolean(object.backupAvailable) : false,
datashare: isSet(object.datashare) ? globalThis.Boolean(object.datashare) : false,
secrets: globalThis.Array.isArray(object?.secrets) ? object.secrets.map((e: any) => Secret.fromJSON(e)) : [],
+ drifted: isSet(object.drifted) ? globalThis.Boolean(object.drifted) : false,
};
},
@@ -1217,6 +1231,9 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
if (message.secrets?.length) {
obj.secrets = message.secrets.map((e) => Secret.toJSON(e));
}
+ if (message.drifted !== false) {
+ obj.drifted = message.drifted;
+ }
return obj;
},
@@ -1237,6 +1254,7 @@ export const DatabaseMetadata: MessageFns<DatabaseMetadata> = {
message.backupAvailable = object.backupAvailable ?? false;
message.datashare = object.datashare ?? false;
message.secrets = object.secrets?.map((e) => Secret.fromPartial(e)) || [];
+ message.drifted = object.drifted ?? false;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/database_service.ts b/frontend/src/types/proto/v1/database_service.ts
index 91f4d3f360..6cd448c8a8 100644
--- a/frontend/src/types/proto/v1/database_service.ts
+++ b/frontend/src/types/proto/v1/database_service.ts
@@ -305,6 +305,8 @@ export interface Database {
| undefined;
/** The database is available for DML prior backup. */
backupAvailable: boolean;
+ /** The schema is drifted from the source of truth. */
+ drifted: boolean;
}
export interface Database_LabelsEntry {
@@ -2860,6 +2862,7 @@ function createBaseDatabase(): Database {
labels: {},
instanceResource: undefined,
backupAvailable: false,
+ drifted: false,
};
}
@@ -2895,6 +2898,9 @@ export const Database: MessageFns<Database> = {
if (message.backupAvailable !== false) {
writer.uint32(88).bool(message.backupAvailable);
}
+ if (message.drifted !== false) {
+ writer.uint32(96).bool(message.drifted);
+ }
return writer;
},
@@ -2988,6 +2994,14 @@ export const Database: MessageFns<Database> = {
message.backupAvailable = reader.bool();
continue;
}
+ case 12: {
+ if (tag !== 96) {
+ break;
+ }
+
+ message.drifted = reader.bool();
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -3014,6 +3028,7 @@ export const Database: MessageFns<Database> = {
: {},
instanceResource: isSet(object.instanceResource) ? InstanceResource.fromJSON(object.instanceResource) : undefined,
backupAvailable: isSet(object.backupAvailable) ? globalThis.Boolean(object.backupAvailable) : false,
+ drifted: isSet(object.drifted) ? globalThis.Boolean(object.drifted) : false,
};
},
@@ -3055,6 +3070,9 @@ export const Database: MessageFns<Database> = {
if (message.backupAvailable !== false) {
obj.backupAvailable = message.backupAvailable;
}
+ if (message.drifted !== false) {
+ obj.drifted = message.drifted;
+ }
return obj;
},
@@ -3082,6 +3100,7 @@ export const Database: MessageFns<Database> = {
? InstanceResource.fromPartial(object.instanceResource)
: undefined;
message.backupAvailable = object.backupAvailable ?? false;
+ message.drifted = object.drifted ?? false;
return message;
},
};
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 7212e2cef6..7d148333a8 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -9327,6 +9327,10 @@ components:
readOnly: true
type: boolean
description: The database is available for DML prior backup.
+ drifted:
+ readOnly: true
+ type: boolean
+ description: The schema is drifted from the source of truth.
DatabaseCatalog:
type: object
properties:
@@ -9394,6 +9398,9 @@ components:
type: array
items:
$ref: '#/components/schemas/Secret'
+ drifted:
+ type: boolean
+ description: The schema is drifted from the source of truth.
description: DatabaseMetadata is the metadata for databases.
DatabaseSchema:
type: object
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index cb899bfe10..0d06e83fb2 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -1205,6 +1205,7 @@ DatabaseMetadata is the metadata for databases.
| backup_available | [bool](#bool) | | |
| datashare | [bool](#bool) | | |
| secrets | [Secret](#bytebase-store-Secret) | repeated | |
+| drifted | [bool](#bool) | | The schema is drifted from the source of truth. |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index ba02630f27..0f7d028170 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -3553,6 +3553,13 @@ classification and user_comment is parsed from the comment. </p></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>drifted</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>The schema is drifted from the source of truth. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 4c3992e000..1bc53e892d 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -2126,6 +2126,7 @@ ColumnMetadata is the metadata for columns.
| labels | [Database.LabelsEntry](#bytebase-v1-Database-LabelsEntry) | repeated | Labels will be used for deployment and policy control. |
| instance_resource | [InstanceResource](#bytebase-v1-InstanceResource) | | The instance resource. |
| backup_available | [bool](#bool) | | The database is available for DML prior backup. |
+| drifted | [bool](#bool) | | The schema is drifted from the source of truth. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 50bbac1fae..f8e5dcc260 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -6670,6 +6670,13 @@ https://cloud.google.com/resource-manager/docs/tags/tags-overview. </p></td>
<td><p>The database is available for DML prior backup. </p></td>
</tr>
+ <tr>
+ <td>drifted</td>
+ <td><a href="#bool">bool</a></td>
+ <td></td>
+ <td><p>The schema is drifted from the source of truth. </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/store/database.pb.go b/proto/generated-go/store/database.pb.go
index f614eb6d3e..24fb8cd59c 100644
--- a/proto/generated-go/store/database.pb.go
+++ b/proto/generated-go/store/database.pb.go
@@ -408,8 +408,10 @@ type DatabaseMetadata struct {
BackupAvailable bool `protobuf:"varint,3,opt,name=backup_available,json=backupAvailable,proto3" json:"backup_available,omitempty"`
Datashare bool `protobuf:"varint,4,opt,name=datashare,proto3" json:"datashare,omitempty"`
Secrets []*Secret `protobuf:"bytes,5,rep,name=secrets,proto3" json:"secrets,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // The schema is drifted from the source of truth.
+ Drifted bool `protobuf:"varint,6,opt,name=drifted,proto3" json:"drifted,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *DatabaseMetadata) Reset() {
@@ -477,6 +479,13 @@ func (x *DatabaseMetadata) GetSecrets() []*Secret {
return nil
}
+func (x *DatabaseMetadata) GetDrifted() bool {
+ if x != nil {
+ return x.Drifted
+ }
+ return false
+}
+
// DatabaseSchemaMetadata is the schema metadata for databases.
type DatabaseSchemaMetadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -3779,13 +3788,14 @@ var File_store_database_proto protoreflect.FileDescriptor
const file_store_database_proto_rawDesc = "" +
"\n" +
- "\x14store/database.proto\x12\x0ebytebase.store\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x12store/common.proto\"\xd0\x02\n" +
+ "\x14store/database.proto\x12\x0ebytebase.store\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x12store/common.proto\"\xea\x02\n" +
"\x10DatabaseMetadata\x12D\n" +
"\x06labels\x18\x01 \x03(\v2,.bytebase.store.DatabaseMetadata.LabelsEntryR\x06labels\x12@\n" +
"\x0elast_sync_time\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\flastSyncTime\x12)\n" +
"\x10backup_available\x18\x03 \x01(\bR\x0fbackupAvailable\x12\x1c\n" +
"\tdatashare\x18\x04 \x01(\bR\tdatashare\x120\n" +
- "\asecrets\x18\x05 \x03(\v2\x16.bytebase.store.SecretR\asecrets\x1a9\n" +
+ "\asecrets\x18\x05 \x03(\v2\x16.bytebase.store.SecretR\asecrets\x12\x18\n" +
+ "\adrifted\x18\x06 \x01(\bR\adrifted\x1a9\n" +
"\vLabelsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x96\x03\n" +
diff --git a/proto/generated-go/v1/database_service.pb.go b/proto/generated-go/v1/database_service.pb.go
index 3d0f6bee68..52edfd4def 100644
--- a/proto/generated-go/v1/database_service.pb.go
+++ b/proto/generated-go/v1/database_service.pb.go
@@ -1430,8 +1430,10 @@ type Database struct {
InstanceResource *InstanceResource `protobuf:"bytes,10,opt,name=instance_resource,json=instanceResource,proto3" json:"instance_resource,omitempty"`
// The database is available for DML prior backup.
BackupAvailable bool `protobuf:"varint,11,opt,name=backup_available,json=backupAvailable,proto3" json:"backup_available,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ // The schema is drifted from the source of truth.
+ Drifted bool `protobuf:"varint,12,opt,name=drifted,proto3" json:"drifted,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *Database) Reset() {
@@ -1534,6 +1536,13 @@ func (x *Database) GetBackupAvailable() bool {
return false
}
+func (x *Database) GetDrifted() bool {
+ if x != nil {
+ return x.Drifted
+ }
+ return false
+}
+
// DatabaseMetadata is the metadata for databases.
type DatabaseMetadata struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -5952,7 +5961,7 @@ const file_v1_database_service_proto_rawDesc = "" +
"sdl_format\x18\x04 \x01(\bR\tsdlFormatB\b\n" +
"\x06target\"(\n" +
"\x12DiffSchemaResponse\x12\x12\n" +
- "\x04diff\x18\x01 \x01(\tR\x04diff\"\x92\x05\n" +
+ "\x04diff\x18\x01 \x01(\tR\x04diff\"\xb2\x05\n" +
"\bDatabase\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12.\n" +
"\x05state\x18\x03 \x01(\x0e2\x12.bytebase.v1.StateB\x04\xe2A\x01\x03R\x05state\x12R\n" +
@@ -5964,7 +5973,8 @@ const file_v1_database_service_proto_rawDesc = "" +
"\x06labels\x18\t \x03(\v2!.bytebase.v1.Database.LabelsEntryR\x06labels\x12P\n" +
"\x11instance_resource\x18\n" +
" \x01(\v2\x1d.bytebase.v1.InstanceResourceB\x04\xe2A\x01\x03R\x10instanceResource\x12/\n" +
- "\x10backup_available\x18\v \x01(\bB\x04\xe2A\x01\x03R\x0fbackupAvailable\x1a9\n" +
+ "\x10backup_available\x18\v \x01(\bB\x04\xe2A\x01\x03R\x0fbackupAvailable\x12\x1e\n" +
+ "\adrifted\x18\f \x01(\bB\x04\xe2A\x01\x03R\adrifted\x1a9\n" +
"\vLabelsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01:E\xeaAB\n" +
diff --git a/proto/store/database.proto b/proto/store/database.proto
index 6174650d09..59275e9acc 100644
--- a/proto/store/database.proto
+++ b/proto/store/database.proto
@@ -15,6 +15,8 @@ message DatabaseMetadata {
bool backup_available = 3;
bool datashare = 4;
repeated Secret secrets = 5;
+ // The schema is drifted from the source of truth.
+ bool drifted = 6;
}
// DatabaseSchemaMetadata is the schema metadata for databases.
diff --git a/proto/v1/database_service.proto b/proto/v1/database_service.proto
index 6aa5508c40..657a38881e 100644
--- a/proto/v1/database_service.proto
+++ b/proto/v1/database_service.proto
@@ -412,6 +412,9 @@ message Database {
// The database is available for DML prior backup.
bool backup_available = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The schema is drifted from the source of truth.
+ bool drifted = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// DatabaseMetadata is the metadata for databases.