“Follow user” database table design

后端 未结 2 935
广开言路
广开言路 2020-12-24 15:24

I\'m trying to determine the best table design for a \"follow/unfollow user\" feature, similar to Twitter (edit: I\'m not making a Twitter-like application.

2条回答
  •  时光说笑
    2020-12-24 16:05

    I think it's a very good design, and should meet your needs nicely. One thing; you should probably make the follower and following foreign keys. Oh, and for simplicity sake, I'd make the subscribed column TIMESTAMP DEFAULT CURRENT_TIMESTAMP just to capture the datetime the user subscribed.

提交回复
热议问题