We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot declare a table with foreign key renaming for multiple fields
Include:
%{ pk_a: varchar(12) %} classdef A < dj.Manual end
%{ pk_b : varchar(12) %} classdef B < dj.Manual end
%{ -> subject.A -> subject.B %} classdef C < dj.Manual end
%{ (pk_da, pk_db) -> subject.C %} classdef D < dj.Manual end
>> subject.D ans = Object subject.D Error using dj.internal.Declare.makeFK (line 304) Mapped fields (pk_da,pk_db) and () must match in the foreign key. Error in dj.internal.Declare.declare (line 152) dj.internal.Declare.makeFK( ... Error in dj.internal.Table/create (line 624) [sql, external_stores] = dj.internal.Declare.declare(self, def); Error in dj.internal.Table/get.plainTableName (line 116) self.create Error in dj.internal.Table/get.tableHeader (line 83) self.tableHeader = self.schema.headers(self.plainTableName); Error in dj.internal.GeneralRelvar/compile (line 676) header = derive(tab.tableHeader); Error in dj.internal.GeneralRelvar/get.header (line 43) header = self.compile; Error in dj.internal.GeneralRelvar/disp (line 73) hdr = self.header;
If I do
%{ pk1: varchar(12) pk2: varchar(12) %} classdef A < dj.Manual end
%{ (f1, f2) -> subject.A(pk1, pk2) %} classdef B < dj.Manual end
It worked.
The text was updated successfully, but these errors were encountered:
Tried two more cases, good to be added to the test cases.
This works:
%{ -> subject.A pk_b: varchar(12) %} classdef B < dj.Manual end
%{ (pk_ca, pk_cb) -> subject.B %} classdef C < dj.Manual end
This does not:
%{ -> subject.B %} classdef C < dj.Manual end
%{ (pk_da, pk_db)-> subject.C(pk_a, pk_b) %} classdef D < dj.Manual end
It gave error:
Mapped fields (pk_da,pk_db) and () must match in the foreign key. Error in dj.internal.Declare.declare (line 152) dj.internal.Declare.makeFK( ... Error in dj.internal.Table/create (line 624) [sql, external_stores] = dj.internal.Declare.declare(self, def); Error in dj.internal.Table/get.plainTableName (line 116) self.create Error in dj.internal.Table/get.tableHeader (line 83) self.tableHeader = self.schema.headers(self.plainTableName); Error in dj.internal.GeneralRelvar/compile (line 676) header = derive(tab.tableHeader); Error in dj.internal.GeneralRelvar/get.header (line 43) header = self.compile; Error in dj.internal.GeneralRelvar/disp (line 73) hdr = self.header;
Sorry, something went wrong.
No branches or pull requests
Cannot declare a table with foreign key renaming for multiple fields
Reproducibility
Include:
When declaring D, I got the following error:
If I do
It worked.
The text was updated successfully, but these errors were encountered: