0

我有一个用于管理商店系统的产品/项目的数据库。表结构看起来像

Categories
----------------------------
id
name
description
active
created
modified



Products
----------------------------
id
name
description
active
created
modified
id_category

现在我有兴趣将这个数据库用于多个商店。修改架构的最佳方法是什么。通过id_shop在每个表中添加一个?或者,还有更好的方法

谢谢

4

2 回答 2

0

I think that a basic compromise is the following schema

enter image description here

In this case you can ad more categories to a single product

于 2012-08-29T16:56:55.687 回答
0
Shops
----------
shop_id
ShopName
AhopAddr
...

Categories
----------------------------
id
name
description
active
created
modified
shop_id

Products
----------------------------
id
name
description
active
created
modified
id_category
shop_id
于 2012-08-29T16:25:14.733 回答