mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-02 21:53:30 +00:00
Track new primary key (#9145)
This commit is contained in:
parent
38c1bf4e54
commit
b5b29c93f5
@ -212,7 +212,7 @@ class SqlColumnHandlerMixin:
|
|||||||
table_constraints.append(
|
table_constraints.append(
|
||||||
TableConstraint(
|
TableConstraint(
|
||||||
constraintType=ConstraintType.PRIMARY_KEY,
|
constraintType=ConstraintType.PRIMARY_KEY,
|
||||||
columns=pk_columns,
|
columns=[column["name"]],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
col_data_length = self._check_col_length(col_type, column["type"])
|
col_data_length = self._check_col_length(col_type, column["type"])
|
||||||
|
@ -248,7 +248,6 @@ public final class ChangeEventParser {
|
|||||||
for (FieldChange field : fields) {
|
for (FieldChange field : fields) {
|
||||||
// if field name has dots, then it is an array field
|
// if field name has dots, then it is an array field
|
||||||
String fieldName = field.getName();
|
String fieldName = field.getName();
|
||||||
|
|
||||||
String newFieldValue = getFieldValue(field.getNewValue());
|
String newFieldValue = getFieldValue(field.getNewValue());
|
||||||
String oldFieldValue = getFieldValue(field.getOldValue());
|
String oldFieldValue = getFieldValue(field.getOldValue());
|
||||||
EntityLink link = getEntityLink(fieldName, entity);
|
EntityLink link = getEntityLink(fieldName, entity);
|
||||||
@ -270,7 +269,6 @@ public final class ChangeEventParser {
|
|||||||
if (CommonUtil.nullOrEmpty(fieldValue)) {
|
if (CommonUtil.nullOrEmpty(fieldValue)) {
|
||||||
return StringUtils.EMPTY;
|
return StringUtils.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Check if field value is a json string
|
// Check if field value is a json string
|
||||||
JsonValue json = JsonUtils.readJson(fieldValue.toString());
|
JsonValue json = JsonUtils.readJson(fieldValue.toString());
|
||||||
@ -288,6 +286,8 @@ public final class ChangeEventParser {
|
|||||||
} else if (keys.contains(FIELD_NAME)) {
|
} else if (keys.contains(FIELD_NAME)) {
|
||||||
// Glossary term references have only "name" field
|
// Glossary term references have only "name" field
|
||||||
labels.add(item.asJsonObject().getString(FIELD_NAME));
|
labels.add(item.asJsonObject().getString(FIELD_NAME));
|
||||||
|
} else if (keys.contains("constraintType")) {
|
||||||
|
labels.add(item.asJsonObject().getString("constraintType"));
|
||||||
}
|
}
|
||||||
} else if (item.getValueType() == ValueType.STRING) {
|
} else if (item.getValueType() == ValueType.STRING) {
|
||||||
// The string might be enclosed with double quotes
|
// The string might be enclosed with double quotes
|
||||||
@ -415,7 +415,8 @@ public final class ChangeEventParser {
|
|||||||
if (Entity.FIELD_FOLLOWERS.equals(updatedField)) {
|
if (Entity.FIELD_FOLLOWERS.equals(updatedField)) {
|
||||||
message = String.format("Unfollowed %s `%s`", link.getEntityType(), link.getEntityFQN());
|
message = String.format("Unfollowed %s `%s`", link.getEntityType(), link.getEntityFQN());
|
||||||
} else {
|
} else {
|
||||||
message = String.format(("Deleted " + getBold(publishTo)), updatedField);
|
message =
|
||||||
|
String.format(("Deleted " + getBold(publishTo) + ": `%s`"), updatedField, getFieldValue(oldFieldValue));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -51,7 +51,9 @@
|
|||||||
"description",
|
"description",
|
||||||
"owner",
|
"owner",
|
||||||
"tags",
|
"tags",
|
||||||
"followers"
|
"followers",
|
||||||
|
"tableConstraints",
|
||||||
|
"constraint"
|
||||||
],
|
],
|
||||||
"exclude": []
|
"exclude": []
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user