Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1. # 总体修改愿望
  2. * 规范每个表的created_at字段、updated_at字段;在需要软删除的表(例如商品等表)使用deleted_at字段。方便框架自行管理。
  3. * 编写数据库migration,规定将来对数据库改动也必须使用migration,以便于部署,同时也可以在git上显示、追溯数据库的变动记录。
  4. * 改动较大,建议重建。
  5.  
  6. # 基本表结构愿望
  7. - 基本信息
  8. * Language(语言)
  9. 字段|指示|备注
  10. -|-|-
  11. id|PK AI|
  12. name||
  13. parentId|FK: Language->id|缺省时用于查询父语言的翻译
  14. localeId|FK: Locale->id|
  15. created_at||
  16. updated_at||
  17.  
  18. * Locale(地区)
  19. 字段|指示|备注
  20. -|-|-
  21. id|PK AI|
  22. code||存放"de","en"这种地区代码
  23. created_at||
  24. updated_at||
  25.  
  26. * Locale_translation(地区-翻译) ```本表用于显示某种语言下其他语言的名称```
  27. 字段|指示|备注
  28. -|-|-
  29. localeId|PK FK: Locale->id|混合主键
  30. languageId|PK FK: Language->id|混合主键
  31. created_at||
  32. updated_at||
  33.  
  34. * Media(多媒体)
  35. 字段|指示|备注
  36. -|-|-
  37. id|PK AI|
  38. mediaFolderId|FK: MediaFolder|
  39. mimeType||image/png 之类的
  40. fileName||
  41. fileExtension||
  42. fileSize||
  43. metaData|Json|图片视频的分辨率,视频音频的长度等
  44. uploaded_at||没有uploaded_at的视为上传失败的
  45. created_at||
  46. updated_at||
  47.  
  48. * MediaFolder(多媒体文件夹)
  49. 字段|指示|备注
  50. -|-|-
  51. id|PK AI|
  52. parentId|FK: MediaFolder|
  53. name||
  54. created_at||
  55. updated_at||
  56.  
  57. * Country
  58.  
  59. * Country_translation
  60.  
  61. * CountryState
  62.  
  63. * CountryState_translation
  64.  
  65. * Currency
  66.  
  67. * Currency_translation
  68.  
  69. - 商品附属信息
  70. * Attribute(商品属性)
  71.  
  72. * Attribute_translation(商品属性翻译)
  73.  
  74. * AttributeGroup(商品属性组)
  75.  
  76. * AttributeGroup_translation(商品属性组翻译)
  77.  
  78. * Category(分类)
  79. 字段|指示|备注
  80. -|-|-
  81. id|PK AI|
  82. name||
  83. parentId|FK: Category->id|父分类id
  84. path|Json(List)|FK: category->id,指示分类路径
  85. orderNumber||排序用字段
  86. depth||分类深度(元数据)
  87. isActive||是否激活
  88. childCount||子分类计数
  89. mediaId|FK: Media->id|分类图片之类的
  90. created_at||
  91. updated_at||
  92.  
  93. * Category_Tag(分类-标签多对多)
  94. 字段|指示|备注
  95. -|-|-
  96. categoryId|PK FK: Category->id|混合主键
  97. tagId|PK FK: Tag->id|混合主键
  98.  
  99. * Category_translation(分类翻译)
  100. 字段|指示|备注
  101. -|-|-
  102. categoryId|PK FK: Category->id|混合主键
  103. languageId|PK FK: Language->id|混合主键
  104. name||
  105. breadcrum|Json(List)|与category的path相对应的翻译内容
  106. created_at||
  107. updated_at||
  108.  
  109. * Manufacturer(制造商)
  110. 字段|指示|备注
  111. -|-|-
  112. id|PK AI|
  113. link||网站链接
  114. mediaId|FK: Media->id|制作商logo
  115. created_at||
  116. updated_at||
  117.  
  118. * Manufacturer_translation(制造商翻译)
  119. 字段|指示|备注
  120. -|-|-
  121. manufacturerId|PK FK: Manufacturer->id|混合主键
  122. languageId|PK FK: Language->id|混合主键
  123. name||
  124. description||
  125. created_at||
  126. updated_at||
  127.  
  128. * Tag(标签)(单语言)
  129. 字段|指示|备注
  130. -|-|-
  131. id|PK AI|
  132. name||
  133. created_at||
  134. updated_at||
  135.  
  136. * Tax(税)(单语言)
  137. 字段|指示|备注
  138. -|-|-
  139. id|PK AI|
  140. name||
  141. taxRate||
  142. created_at||
  143. updated_at||
  144.  
  145. * Price(价格规则组)
  146. * Rule(价格规则)
  147.  
  148. - 商品信息
  149. * Product
  150.  
  151. * Product_Category(商品-分类多对多)(最终结果)
  152.  
  153. * Product_Category_tree(商品-分类多对多)(完整结构树)
  154.  
  155. * Product_Manufacturer_translation(商品-制造商翻译)
  156.  
  157. * Product_Media(商品-图片多对多)(商品内置的1对1是主图片,这里是其他附属图片)
  158.  
  159. * Product_Attribute(商品-商品属性多对多)
  160.  
  161. * Product_Price(商品-价格规则组多对多)
  162.  
  163. * Product_Tag(商品-标签多对多)
  164.  
  165. * Product_translation(商品翻译)
  166.  
  167. - 订单信息
  168. * Order
  169.  
  170. * OrderAddress
  171.  
  172. * Order_Customer
  173.  
  174. * OrderDelivery
  175.  
  176. * Order_Item
  177.  
  178. - 购物车
  179. * Cart
  180.  
  181. - 客户信息
  182. * Customer
  183.  
  184. * CustomerAddress
  185.  
  186. * CustomerGroup
  187.  
  188. * CustomerGroup_translation
  189.  
  190. - 自动邮件系统
  191. * MailHeaderFooter
  192.  
  193. * MailHeaderFooter_translation
  194.  
  195. * MailTemplate
  196.  
  197. * MailTemplate_translation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement