New issue
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
Multiple column foreign key and associations? #835
Comments
First, this is not supported: output: function () {
return this.belongsTo(Output, [ 'outputs', 'tx_hash', 'position' ]);
}
If I understand correctly you're trying to define a relationship with a composite primary key. ie. For now - in short - the answer is no. You cannot use |
Ok thanks. |
@rhys-vdw Is there a roadmap for future versions of bookshelf? |
@olalonde Nothing formal yet. Just an idea of where we want to go and what we primarily want ot address. The creation of a roadmap will be preceded by a community discussion, and the plans will all be open for comment. |
I have an
outputs
table with the following columns:tx_hash
andposition
which are its primary key and aninputs
table with following columns:txout_tx_hash
andtxout_position
which respectively referenceoutputs.tx_hash
andoutputs.position
.I would like to have an 'output' relationship on my Input model that I could load like this:
I tried the following without success:
Is there any way I can define the relationship so that I will be able to load it with the
.load()
method? Also is it possible to use multiple columns foridAttribute
?The text was updated successfully, but these errors were encountered: