林在我的头上挠我的头。这是场景。即时通讯使用原则和YAML架构文件:两种数据库表格有两种不同的方式......?
我有一个表用户和表事件
用户看起来是这样的:
User:
columns:
id:
type: integer(7)
email:
type: string(100)
display_name:
type: string(255)
fb_id:
type: string(100)
relations:
Event:
type: many
refClass: UserEvent
事件是这样的:
Event:
columns:
id:
type: integer(7)
initiator_id:
type: integer(7)
loc_latitude:
type: decimal(11)
loc_longitude:
type: decimal(11)
4sq_id:
type: integer(11)
relations:
User:
type: one
local: initiator_id
foreign: id
User:
type: many
refClass: UserEvent
由于你可以看到问题是这样的:用户(或'发起者')可以启动许多事件,并且事件可以属于一个用户('发起者')。但是,一个事件也可以有许多加入它的用户,并且用户可以加入许多事件。
因此,事件和用户最终以两种不同的方式相关。这个怎么用?是否有可能这样做,或者我错过了什么?
你应该写这个答案@Tom – Beno 2011-06-01 23:03:54