林在我的頭上撓我的頭。這是場景。即時通訊使用原則和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