mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-14 09:51:13 +00:00
parent
1e3652d35e
commit
df2001418e
@ -32,7 +32,7 @@ import org.openmetadata.service.util.EntityUtil.Fields;
|
|||||||
import org.openmetadata.service.util.FullyQualifiedName;
|
import org.openmetadata.service.util.FullyQualifiedName;
|
||||||
|
|
||||||
public class DatabaseSchemaRepository extends EntityRepository<DatabaseSchema> {
|
public class DatabaseSchemaRepository extends EntityRepository<DatabaseSchema> {
|
||||||
private static final String DATABASE_SCHEMA_UPDATE_FIELDS = "owner";
|
private static final String DATABASE_SCHEMA_UPDATE_FIELDS = "owner,tags";
|
||||||
private static final String DATABASE_SCHEMA_PATCH_FIELDS = DATABASE_SCHEMA_UPDATE_FIELDS;
|
private static final String DATABASE_SCHEMA_PATCH_FIELDS = DATABASE_SCHEMA_UPDATE_FIELDS;
|
||||||
|
|
||||||
public DatabaseSchemaRepository(CollectionDAO dao) {
|
public DatabaseSchemaRepository(CollectionDAO dao) {
|
||||||
@ -77,6 +77,8 @@ public class DatabaseSchemaRepository extends EntityRepository<DatabaseSchema> {
|
|||||||
addRelationship(
|
addRelationship(
|
||||||
database.getId(), schema.getId(), database.getType(), Entity.DATABASE_SCHEMA, Relationship.CONTAINS);
|
database.getId(), schema.getId(), database.getType(), Entity.DATABASE_SCHEMA, Relationship.CONTAINS);
|
||||||
storeOwner(schema, schema.getOwner());
|
storeOwner(schema, schema.getOwner());
|
||||||
|
// Add tag to databaseSchema relationship
|
||||||
|
applyTags(schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<EntityReference> getTables(DatabaseSchema schema) throws IOException {
|
private List<EntityReference> getTables(DatabaseSchema schema) throws IOException {
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class DatabaseSchemaResourceTest extends EntityResourceTest<DatabaseSchema, Crea
|
|||||||
assertListNotNull(schema.getService(), schema.getServiceType(), schema.getDatabase());
|
assertListNotNull(schema.getService(), schema.getServiceType(), schema.getDatabase());
|
||||||
assertListNull(schema.getOwner(), schema.getTables());
|
assertListNull(schema.getOwner(), schema.getTables());
|
||||||
|
|
||||||
fields = "owner,tables";
|
fields = "owner,tags,tables";
|
||||||
schema =
|
schema =
|
||||||
byName
|
byName
|
||||||
? getEntityByName(schema.getFullyQualifiedName(), fields, ADMIN_AUTH_HEADERS)
|
? getEntityByName(schema.getFullyQualifiedName(), fields, ADMIN_AUTH_HEADERS)
|
||||||
|
|||||||
@ -77,6 +77,14 @@
|
|||||||
"$ref": "../../type/usageDetails.json",
|
"$ref": "../../type/usageDetails.json",
|
||||||
"default": null
|
"default": null
|
||||||
},
|
},
|
||||||
|
"tags": {
|
||||||
|
"description": "Tags for this Database Schema Service.",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "../../type/tagLabel.json"
|
||||||
|
},
|
||||||
|
"default": null
|
||||||
|
},
|
||||||
"changeDescription": {
|
"changeDescription": {
|
||||||
"description": "Change that lead to this version of the entity.",
|
"description": "Change that lead to this version of the entity.",
|
||||||
"$ref": "../../type/entityHistory.json#/definitions/changeDescription"
|
"$ref": "../../type/entityHistory.json#/definitions/changeDescription"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user