mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-06 14:26:28 +00:00
parent
726f7ddf27
commit
2f84bfbfa8
@ -110,3 +110,9 @@ WHERE jsonSchema IN ('tableProfile', 'columnTest', 'tableTest');
|
||||
|
||||
DELETE FROM ingestion_pipeline_entity
|
||||
WHERE LOWER(JSON_EXTRACT(json, '$.pipelineType') = 'profiler');
|
||||
|
||||
DELETE FROM role_entity;
|
||||
DELETE FROM policy_entity;
|
||||
DELETE FROM field_relationship WHERE fromType IN ('role', 'policy') OR toType IN ('role', 'policy');
|
||||
DELETE FROM entity_relationship WHERE fromEntity IN ('role', 'policy') OR toEntity IN ('role', 'policy');
|
||||
ALTER TABLE role_entity DROP COLUMN defaultRole;
|
||||
|
@ -105,3 +105,9 @@ WHERE jsonSchema IN ('tableProfile', 'columnTest', 'tableTest');
|
||||
|
||||
DELETE FROM ingestion_pipeline_entity
|
||||
WHERE json_extract_path_text("json", 'pipelineType') = 'profiler';
|
||||
|
||||
DELETE FROM role_entity;
|
||||
DELETE FROM policy_entity;
|
||||
DELETE FROM field_relationship WHERE fromType IN ('role', 'policy') OR toType IN ('role', 'policy');
|
||||
DELETE FROM entity_relationship WHERE fromEntity IN ('role', 'policy') OR toEntity IN ('role', 'policy');
|
||||
ALTER TABLE role_entity DROP COLUMN defaultRole;
|
||||
|
@ -1125,7 +1125,10 @@ public abstract class EntityRepository<T extends EntityInterface> {
|
||||
this.original = original;
|
||||
this.updated = updated;
|
||||
this.operation = operation;
|
||||
this.updatingUser = SubjectCache.getInstance().getSubjectContext(updated.getUpdatedBy()).getUser();
|
||||
this.updatingUser =
|
||||
updated.getUpdatedBy().equalsIgnoreCase("admin")
|
||||
? new User().withName("admin").withIsAdmin(true)
|
||||
: SubjectCache.getInstance().getSubjectContext(updated.getUpdatedBy()).getUser();
|
||||
}
|
||||
|
||||
/** Compare original and updated entities and perform updates. Update the entity version and track changes. */
|
||||
|
@ -328,6 +328,8 @@ public class TeamRepository extends EntityRepository<Team> {
|
||||
String json = dao.findJsonByFqn(ORGANIZATION_NAME, Include.ALL);
|
||||
if (json == null) {
|
||||
LOG.debug("Organization {} is not initialized", ORGANIZATION_NAME);
|
||||
// Teams
|
||||
try {
|
||||
EntityReference organizationPolicy = Entity.getEntityReferenceByName(POLICY, "OrganizationPolicy", Include.ALL);
|
||||
EntityReference dataConsumerRole = Entity.getEntityReferenceByName(ROLE, "DataConsumer", Include.ALL);
|
||||
Team team =
|
||||
@ -341,8 +343,6 @@ public class TeamRepository extends EntityRepository<Team> {
|
||||
.withUpdatedAt(System.currentTimeMillis())
|
||||
.withPolicies(new ArrayList<>(List.of(organizationPolicy)))
|
||||
.withDefaultRoles(new ArrayList<>(List.of(dataConsumerRole)));
|
||||
// Teams
|
||||
try {
|
||||
organization = create(null, team);
|
||||
LOG.info("Organization {}:{} is successfully initialized", ORGANIZATION_NAME, organization.getId());
|
||||
} catch (Exception e) {
|
||||
|
@ -111,7 +111,7 @@ public class TypeResource extends EntityResource<Type, TypeRepository> {
|
||||
}
|
||||
this.dao.createOrUpdate(null, type);
|
||||
this.dao.addToRegistry(type);
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error loading type {}", type.getName(), e);
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user