开发者

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 --

  1. ID
  2. expression
  3. 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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜