Skip to content

Commit

Permalink
fix(relationship): fix ambiguous reference to deleted_ts column
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Donn committed Mar 1, 2025
1 parent fbd5e65 commit 7c90a96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ protected boolean isMgEntityType(@Nonnull String entityType) {
return _mgEntityTypeNameSet.contains(StringUtils.lowerCase(entityType));
}


/**
* Extracts the table name from an entity urn for MG entities. If entityUrn is not for MG entity, return null.
* @param entityType String representing the type of entity (e.g. "dataset")
Expand Down Expand Up @@ -437,7 +436,7 @@ private String buildFindRelationshipSQL(
}
}

sqlBuilder.append("WHERE deleted_ts is NULL");
sqlBuilder.append("WHERE rt.deleted_ts is NULL");

filters.add(new Pair<>(relationshipFilter, "rt"));

Expand All @@ -449,7 +448,7 @@ private String buildFindRelationshipSQL(
sqlBuilder.append(" AND ").append(whereClause);
}
} else if (_schemaConfig == EbeanLocalDAO.SchemaConfig.OLD_SCHEMA_ONLY) {
sqlBuilder.append("WHERE deleted_ts IS NULL");
sqlBuilder.append("WHERE rt.deleted_ts IS NULL");
if (sourceEntityFilter != null) {
validateEntityFilterOnlyOneUrn(sourceEntityFilter);
if (sourceEntityFilter.hasCriteria() && sourceEntityFilter.getCriteria().size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ CREATE TABLE IF NOT EXISTS metadata_entity_foo (
lastmodifiedon TIMESTAMP NOT NULL,
lastmodifiedby VARCHAR(255) NOT NULL,
createdfor VARCHAR(255),
deleted_ts DATETIME(6) DEFAULT NULL,
CONSTRAINT pk_metadata_entity_foo PRIMARY KEY (urn)
);

Expand Down

0 comments on commit 7c90a96

Please sign in to comment.