Multiple foreign keys to same table using Elixir
I am new to ORMs in general. I have a table (lets call it Entity) with columns --
- ID
- expression
- type ( can be 'long_word', 'short_word' or 'sentence' )
Often, the first two types occur in a 'sentence
', so, I want to maintain another开发者_如何学Python table which maps 'Sentences
' to 'long_word
' or 'short_word
' using the 'ID
' field.
All i need is another table with 2 'Integer fields
' referring to 'ID
' as a foreign key.
But, how do i do this in Elixir?
Edit : I was afraid it will come to this eventually. No sweat, SQLAlchemy is solid, it will be worth it in the long run. But i really wish Elixir had worked. Cant have everything the way you want.
Thanks a lot...
精彩评论