Skip to content

Commit a3b4c20

Browse files
committed
check fks.aliased as matrix
1 parent 8fdfe14 commit a3b4c20

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

+dj/Relvar.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function cleanup(self)
9292
@(x) strcmp(x.from, rels(ix).fullTableName), ...
9393
self.schema.conn.foreignKeys, 'uni', true);
9494
fks = self.schema.conn.foreignKeys(fk_index);
95-
if ~fks.aliased
95+
if ~all([fks.aliased])
9696
% If matched foreign keys are not aliased, no renaming
9797
% necessary. Restrict table based on normal projection.
9898
rels(ix).restrict(proj(rels(i)));

tests/test_schemas/+TestLab/Duty.m

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
%{
2+
duty_date: date
3+
-----
4+
(duty_first) -> TestLab.User(user_id)
5+
(duty_second) -> TestLab.User(user_id)
6+
%}
7+
8+
classdef Duty < dj.Manual
9+
end

tests/test_schemas/+TestLab/User.m

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
%{
2+
user_id: varchar(32)
3+
%}
4+
5+
classdef User < dj.Manual
6+
end

0 commit comments

Comments
 (0)