Skip to content

Commit

Permalink
fixed wrong constraint name
Browse files Browse the repository at this point in the history
  • Loading branch information
datomo committed Apr 4, 2024
1 parent 9cb220b commit f5eb2e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public boolean isConstraint( long keyId ) {
@Override
public @NonNull List<LogicalConstraint> getConstraints( long tableId ) {
List<Long> keysOfTable = getTableKeys( tableId ).stream().map( t -> t.id ).toList();
return constraints.values().stream().filter( c -> keysOfTable.contains( c.keyId ) ).collect( Collectors.toList() );
return constraints.values().stream().filter( c -> keysOfTable.contains( c.keyId ) ).toList();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2707,7 +2707,7 @@ public void createConstraint( ConstraintInformation information, long namespaceI
}
long columnId = catalog.getSnapshot().rel().getColumn( foreignTableId, information.foreignKeyColumnName ).orElseThrow().id;
catalog.getLogicalRel( namespaceId ).addForeignKey( tableId, columnIds, foreignTableId, List.of( columnId ), constraintName, ForeignKeyOption.NONE, ForeignKeyOption.NONE );
catalog.getLogicalRel( namespaceId ).addConstraint( tableId, ConstraintType.PRIMARY.name(), columnIds, ConstraintType.FOREIGN );
catalog.getLogicalRel( namespaceId ).addConstraint( tableId, ConstraintType.FOREIGN.name(), columnIds, ConstraintType.FOREIGN );

break;
}
Expand Down

0 comments on commit f5eb2e2

Please sign in to comment.