Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

表结构不太合理,数据有点散乱 #246

Open
yrong opened this issue Aug 5, 2019 · 5 comments
Open

表结构不太合理,数据有点散乱 #246

yrong opened this issue Aug 5, 2019 · 5 comments

Comments

@yrong
Copy link

yrong commented Aug 5, 2019

  • litemall_goods_product最好改成litemall_goods_sku

  • litemall_goods_product的specifications字段看上去应该是对litemall_goods_specification的引用,或者用一个json字段存储包含多个属性名值对的组合

@linlinjava
Copy link
Owner

谢谢你的意见,但是
(1)表命名这个无所谓吧,这个能称之为表结构不合理?
(2)litemall_goods_product的specifications字段的确是一个json列表,里面是存放litemall_goods_specification的ID。如果你改成属性名值对也是可以的,这里采用litemall_goods_specification可以多存储一些属性相关的信息。

谢谢。

@yrong
Copy link
Author

yrong commented Aug 5, 2019

问题现在存的是明文,不是引用

@linlinjava linlinjava reopened this Aug 5, 2019
@linlinjava
Copy link
Owner

嗯对我居然说错了,存的是属性值列表,这里是为了之前返回给前端,不需要再查询数据库。
像你说的存放属性名值对的组合更能更好。

不过现在暂时运行还可以,后面有需要再调整吧。

谢谢你的建议。

@spiritelf
Copy link

的确看到存的是明文,利弊都有什么?

@billgame
Copy link

billgame commented Sep 6, 2022

表格 id 为什么不用 bigint 呢,我怕不够用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants