4
我正在開發一個社交網絡應用程序,並希望創建一個活動供稿,以便人們可以跟上他們所有的連接(經典facebook流)。我有一個數據庫表叫activity
設置爲這個像這樣:社交網絡活動Feed +羣組
activity_id (int)
user_id (int) //who posted it
group_id (int) //the group of connections that have permission to view
type (enum) //the type of activity performed
time (datetime) //the time the activity was performed
然後,我會做一個select * from activity where user_id in (connections)
得到的最新消息。
這裏是捕獲。用戶的活動並不總能看到整套連接。用戶可以創建用戶標識組,以在其超級連接集中形成更小的集合。它就像Facebook允許你指定誰看到一個特定的帖子,而不是讓所有的朋友看到它。
我有以下架構的獨立groups
表設置:
group_id (int)
connection_id (user_id, int)
user_id (group creator)
我有我的活動表GROUP_ID。 group_id是指向有權查看帖子的連接子集的鏈接。
我的問題是,做這種類型的飼料的最佳方式是什麼,是否有一個最佳的單選語句,將得到我想要的輸出(我已被授予查看權限的連接活動列表)?
謝謝。
你最終搞清楚了嗎? –
我擱置了一下項目,所以我停下來打獵。如果你弄清楚,讓我知道。 – Imq