db_schema.xml 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  9. xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
  10. <table name="eav_entity_type" resource="default" engine="innodb" comment="Eav Entity Type">
  11. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="true"
  12. comment="Entity Type Id"/>
  13. <column xsi:type="varchar" name="entity_type_code" nullable="false" length="50" comment="Entity Type Code"/>
  14. <column xsi:type="varchar" name="entity_model" nullable="false" length="255" comment="Entity Model"/>
  15. <column xsi:type="varchar" name="attribute_model" nullable="true" length="255" comment="Attribute Model"/>
  16. <column xsi:type="varchar" name="entity_table" nullable="true" length="255" comment="Entity Table"/>
  17. <column xsi:type="varchar" name="value_table_prefix" nullable="true" length="255" comment="Value Table Prefix"/>
  18. <column xsi:type="varchar" name="entity_id_field" nullable="true" length="255" comment="Entity ID Field"/>
  19. <column xsi:type="smallint" name="is_data_sharing" padding="5" unsigned="true" nullable="false" identity="false"
  20. default="1" comment="Defines Is Data Sharing"/>
  21. <column xsi:type="varchar" name="data_sharing_key" nullable="true" length="100" default="default"
  22. comment="Data Sharing Key"/>
  23. <column xsi:type="smallint" name="default_attribute_set_id" padding="5" unsigned="true" nullable="false"
  24. identity="false" default="0" comment="Default Attribute Set Id"/>
  25. <column xsi:type="varchar" name="increment_model" nullable="true" length="255" comment="Increment Model"/>
  26. <column xsi:type="smallint" name="increment_per_store" padding="5" unsigned="true" nullable="false"
  27. identity="false" default="0" comment="Increment Per Store"/>
  28. <column xsi:type="smallint" name="increment_pad_length" padding="5" unsigned="true" nullable="false"
  29. identity="false" default="8" comment="Increment Pad Length"/>
  30. <column xsi:type="varchar" name="increment_pad_char" nullable="false" length="1" default="0"
  31. comment="Increment Pad Char"/>
  32. <column xsi:type="varchar" name="additional_attribute_table" nullable="true" length="255"
  33. comment="Additional Attribute Table"/>
  34. <column xsi:type="varchar" name="entity_attribute_collection" nullable="true" length="255"
  35. comment="Entity Attribute Collection"/>
  36. <constraint xsi:type="primary" referenceId="PRIMARY">
  37. <column name="entity_type_id"/>
  38. </constraint>
  39. <index referenceId="EAV_ENTITY_TYPE_ENTITY_TYPE_CODE" indexType="btree">
  40. <column name="entity_type_code"/>
  41. </index>
  42. </table>
  43. <table name="eav_entity" resource="default" engine="innodb" comment="Eav Entity">
  44. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"
  45. comment="Entity ID"/>
  46. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  47. default="0" comment="Entity Type Id"/>
  48. <column xsi:type="smallint" name="attribute_set_id" padding="5" unsigned="true" nullable="false"
  49. identity="false" default="0" comment="Attribute Set Id"/>
  50. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment Id"/>
  51. <column xsi:type="int" name="parent_id" padding="10" unsigned="true" nullable="false" identity="false"
  52. default="0" comment="Parent Id"/>
  53. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  54. default="0" comment="Store Id"/>
  55. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  56. comment="Created At"/>
  57. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  58. comment="Updated At"/>
  59. <column xsi:type="smallint" name="is_active" padding="5" unsigned="true" nullable="false" identity="false"
  60. default="1" comment="Defines Is Entity Active"/>
  61. <constraint xsi:type="primary" referenceId="PRIMARY">
  62. <column name="entity_id"/>
  63. </constraint>
  64. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  65. table="eav_entity" column="entity_type_id" referenceTable="eav_entity_type"
  66. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  67. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_STORE_ID_STORE_STORE_ID" table="eav_entity" column="store_id"
  68. referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  69. <index referenceId="EAV_ENTITY_ENTITY_TYPE_ID" indexType="btree">
  70. <column name="entity_type_id"/>
  71. </index>
  72. <index referenceId="EAV_ENTITY_STORE_ID" indexType="btree">
  73. <column name="store_id"/>
  74. </index>
  75. </table>
  76. <table name="eav_entity_datetime" resource="default" engine="innodb" comment="Eav Entity Value Prefix">
  77. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  78. comment="Value Id"/>
  79. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  80. default="0" comment="Entity Type Id"/>
  81. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  82. default="0" comment="Attribute Id"/>
  83. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  84. default="0" comment="Store Id"/>
  85. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  86. default="0" comment="Entity ID"/>
  87. <column xsi:type="datetime" name="value" on_update="false" nullable="true" comment="Attribute Value"/>
  88. <constraint xsi:type="primary" referenceId="PRIMARY">
  89. <column name="value_id"/>
  90. </constraint>
  91. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_DATETIME_ENTITY_ID_EAV_ENTITY_ENTITY_ID"
  92. table="eav_entity_datetime" column="entity_id" referenceTable="eav_entity"
  93. referenceColumn="entity_id" onDelete="CASCADE"/>
  94. <constraint xsi:type="foreign" referenceId="EAV_ENTT_DTIME_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID"
  95. table="eav_entity_datetime" column="entity_type_id" referenceTable="eav_entity_type"
  96. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  97. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_DATETIME_STORE_ID_STORE_STORE_ID" table="eav_entity_datetime"
  98. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  99. <constraint xsi:type="unique" referenceId="EAV_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
  100. <column name="entity_id"/>
  101. <column name="attribute_id"/>
  102. <column name="store_id"/>
  103. </constraint>
  104. <index referenceId="EAV_ENTITY_DATETIME_STORE_ID" indexType="btree">
  105. <column name="store_id"/>
  106. </index>
  107. <index referenceId="EAV_ENTITY_DATETIME_ATTRIBUTE_ID_VALUE" indexType="btree">
  108. <column name="attribute_id"/>
  109. <column name="value"/>
  110. </index>
  111. <index referenceId="EAV_ENTITY_DATETIME_ENTITY_TYPE_ID_VALUE" indexType="btree">
  112. <column name="entity_type_id"/>
  113. <column name="value"/>
  114. </index>
  115. </table>
  116. <table name="eav_entity_decimal" resource="default" engine="innodb" comment="Eav Entity Value Prefix">
  117. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  118. comment="Value Id"/>
  119. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  120. default="0" comment="Entity Type Id"/>
  121. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  122. default="0" comment="Attribute Id"/>
  123. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  124. default="0" comment="Store Id"/>
  125. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  126. default="0" comment="Entity ID"/>
  127. <column xsi:type="decimal" name="value" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  128. comment="Attribute Value"/>
  129. <constraint xsi:type="primary" referenceId="PRIMARY">
  130. <column name="value_id"/>
  131. </constraint>
  132. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_DECIMAL_ENTITY_ID_EAV_ENTITY_ENTITY_ID"
  133. table="eav_entity_decimal" column="entity_id" referenceTable="eav_entity"
  134. referenceColumn="entity_id" onDelete="CASCADE"/>
  135. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_DECIMAL_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  136. table="eav_entity_decimal" column="entity_type_id" referenceTable="eav_entity_type"
  137. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  138. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID" table="eav_entity_decimal"
  139. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  140. <constraint xsi:type="unique" referenceId="EAV_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
  141. <column name="entity_id"/>
  142. <column name="attribute_id"/>
  143. <column name="store_id"/>
  144. </constraint>
  145. <index referenceId="EAV_ENTITY_DECIMAL_STORE_ID" indexType="btree">
  146. <column name="store_id"/>
  147. </index>
  148. <index referenceId="EAV_ENTITY_DECIMAL_ATTRIBUTE_ID_VALUE" indexType="btree">
  149. <column name="attribute_id"/>
  150. <column name="value"/>
  151. </index>
  152. <index referenceId="EAV_ENTITY_DECIMAL_ENTITY_TYPE_ID_VALUE" indexType="btree">
  153. <column name="entity_type_id"/>
  154. <column name="value"/>
  155. </index>
  156. </table>
  157. <table name="eav_entity_int" resource="default" engine="innodb" comment="Eav Entity Value Prefix">
  158. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  159. comment="Value Id"/>
  160. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  161. default="0" comment="Entity Type Id"/>
  162. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  163. default="0" comment="Attribute Id"/>
  164. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  165. default="0" comment="Store Id"/>
  166. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  167. default="0" comment="Entity ID"/>
  168. <column xsi:type="int" name="value" padding="11" unsigned="false" nullable="false" identity="false" default="0"
  169. comment="Attribute Value"/>
  170. <constraint xsi:type="primary" referenceId="PRIMARY">
  171. <column name="value_id"/>
  172. </constraint>
  173. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_INT_ENTITY_ID_EAV_ENTITY_ENTITY_ID" table="eav_entity_int"
  174. column="entity_id" referenceTable="eav_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
  175. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_INT_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  176. table="eav_entity_int" column="entity_type_id" referenceTable="eav_entity_type"
  177. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  178. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_INT_STORE_ID_STORE_STORE_ID" table="eav_entity_int"
  179. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  180. <constraint xsi:type="unique" referenceId="EAV_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
  181. <column name="entity_id"/>
  182. <column name="attribute_id"/>
  183. <column name="store_id"/>
  184. </constraint>
  185. <index referenceId="EAV_ENTITY_INT_STORE_ID" indexType="btree">
  186. <column name="store_id"/>
  187. </index>
  188. <index referenceId="EAV_ENTITY_INT_ATTRIBUTE_ID_VALUE" indexType="btree">
  189. <column name="attribute_id"/>
  190. <column name="value"/>
  191. </index>
  192. <index referenceId="EAV_ENTITY_INT_ENTITY_TYPE_ID_VALUE" indexType="btree">
  193. <column name="entity_type_id"/>
  194. <column name="value"/>
  195. </index>
  196. </table>
  197. <table name="eav_entity_text" resource="default" engine="innodb" comment="Eav Entity Value Prefix">
  198. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  199. comment="Value Id"/>
  200. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  201. default="0" comment="Entity Type Id"/>
  202. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  203. default="0" comment="Attribute Id"/>
  204. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  205. default="0" comment="Store Id"/>
  206. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  207. default="0" comment="Entity ID"/>
  208. <column xsi:type="text" name="value" nullable="false" comment="Attribute Value"/>
  209. <constraint xsi:type="primary" referenceId="PRIMARY">
  210. <column name="value_id"/>
  211. </constraint>
  212. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_TEXT_ENTITY_ID_EAV_ENTITY_ENTITY_ID" table="eav_entity_text"
  213. column="entity_id" referenceTable="eav_entity" referenceColumn="entity_id" onDelete="CASCADE"/>
  214. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_TEXT_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  215. table="eav_entity_text" column="entity_type_id" referenceTable="eav_entity_type"
  216. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  217. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_TEXT_STORE_ID_STORE_STORE_ID" table="eav_entity_text"
  218. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  219. <constraint xsi:type="unique" referenceId="EAV_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
  220. <column name="entity_id"/>
  221. <column name="attribute_id"/>
  222. <column name="store_id"/>
  223. </constraint>
  224. <index referenceId="EAV_ENTITY_TEXT_ENTITY_TYPE_ID" indexType="btree">
  225. <column name="entity_type_id"/>
  226. </index>
  227. <index referenceId="EAV_ENTITY_TEXT_ATTRIBUTE_ID" indexType="btree">
  228. <column name="attribute_id"/>
  229. </index>
  230. <index referenceId="EAV_ENTITY_TEXT_STORE_ID" indexType="btree">
  231. <column name="store_id"/>
  232. </index>
  233. </table>
  234. <table name="eav_entity_varchar" resource="default" engine="innodb" comment="Eav Entity Value Prefix">
  235. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  236. comment="Value Id"/>
  237. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  238. default="0" comment="Entity Type Id"/>
  239. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  240. default="0" comment="Attribute Id"/>
  241. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  242. default="0" comment="Store Id"/>
  243. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  244. default="0" comment="Entity ID"/>
  245. <column xsi:type="varchar" name="value" nullable="true" length="255" comment="Attribute Value"/>
  246. <constraint xsi:type="primary" referenceId="PRIMARY">
  247. <column name="value_id"/>
  248. </constraint>
  249. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_VARCHAR_ENTITY_ID_EAV_ENTITY_ENTITY_ID"
  250. table="eav_entity_varchar" column="entity_id" referenceTable="eav_entity"
  251. referenceColumn="entity_id" onDelete="CASCADE"/>
  252. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_VARCHAR_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  253. table="eav_entity_varchar" column="entity_type_id" referenceTable="eav_entity_type"
  254. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  255. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID" table="eav_entity_varchar"
  256. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  257. <constraint xsi:type="unique" referenceId="EAV_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_STORE_ID">
  258. <column name="entity_id"/>
  259. <column name="attribute_id"/>
  260. <column name="store_id"/>
  261. </constraint>
  262. <index referenceId="EAV_ENTITY_VARCHAR_STORE_ID" indexType="btree">
  263. <column name="store_id"/>
  264. </index>
  265. <index referenceId="EAV_ENTITY_VARCHAR_ATTRIBUTE_ID_VALUE" indexType="btree">
  266. <column name="attribute_id"/>
  267. <column name="value"/>
  268. </index>
  269. <index referenceId="EAV_ENTITY_VARCHAR_ENTITY_TYPE_ID_VALUE" indexType="btree">
  270. <column name="entity_type_id"/>
  271. <column name="value"/>
  272. </index>
  273. </table>
  274. <table name="eav_attribute" resource="default" engine="innodb" comment="Eav Attribute">
  275. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="true"
  276. comment="Attribute Id"/>
  277. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  278. default="0" comment="Entity Type Id"/>
  279. <column xsi:type="varchar" name="attribute_code" nullable="false" length="255" comment="Attribute Code"/>
  280. <column xsi:type="varchar" name="attribute_model" nullable="true" length="255" comment="Attribute Model"/>
  281. <column xsi:type="varchar" name="backend_model" nullable="true" length="255" comment="Backend Model"/>
  282. <column xsi:type="varchar" name="backend_type" nullable="false" length="8" default="static"
  283. comment="Backend Type"/>
  284. <column xsi:type="varchar" name="backend_table" nullable="true" length="255" comment="Backend Table"/>
  285. <column xsi:type="varchar" name="frontend_model" nullable="true" length="255" comment="Frontend Model"/>
  286. <column xsi:type="varchar" name="frontend_input" nullable="true" length="50" comment="Frontend Input"/>
  287. <column xsi:type="varchar" name="frontend_label" nullable="true" length="255" comment="Frontend Label"/>
  288. <column xsi:type="varchar" name="frontend_class" nullable="true" length="255" comment="Frontend Class"/>
  289. <column xsi:type="varchar" name="source_model" nullable="true" length="255" comment="Source Model"/>
  290. <column xsi:type="smallint" name="is_required" padding="5" unsigned="true" nullable="false" identity="false"
  291. default="0" comment="Defines Is Required"/>
  292. <column xsi:type="smallint" name="is_user_defined" padding="5" unsigned="true" nullable="false" identity="false"
  293. default="0" comment="Defines Is User Defined"/>
  294. <column xsi:type="text" name="default_value" nullable="true" comment="Default Value"/>
  295. <column xsi:type="smallint" name="is_unique" padding="5" unsigned="true" nullable="false" identity="false"
  296. default="0" comment="Defines Is Unique"/>
  297. <column xsi:type="varchar" name="note" nullable="true" length="255" comment="Note"/>
  298. <constraint xsi:type="primary" referenceId="PRIMARY">
  299. <column name="attribute_id"/>
  300. </constraint>
  301. <constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  302. table="eav_attribute" column="entity_type_id" referenceTable="eav_entity_type"
  303. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  304. <constraint xsi:type="unique" referenceId="EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE">
  305. <column name="entity_type_id"/>
  306. <column name="attribute_code"/>
  307. </constraint>
  308. </table>
  309. <table name="eav_entity_store" resource="default" engine="innodb" comment="Eav Entity Store">
  310. <column xsi:type="int" name="entity_store_id" padding="10" unsigned="true" nullable="false" identity="true"
  311. comment="Entity Store Id"/>
  312. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  313. default="0" comment="Entity Type Id"/>
  314. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  315. default="0" comment="Store Id"/>
  316. <column xsi:type="varchar" name="increment_prefix" nullable="true" length="20" comment="Increment Prefix"/>
  317. <column xsi:type="varchar" name="increment_last_id" nullable="true" length="50" comment="Last Incremented Id"/>
  318. <constraint xsi:type="primary" referenceId="PRIMARY">
  319. <column name="entity_store_id"/>
  320. </constraint>
  321. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_STORE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  322. table="eav_entity_store" column="entity_type_id" referenceTable="eav_entity_type"
  323. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  324. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_STORE_STORE_ID_STORE_STORE_ID" table="eav_entity_store"
  325. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  326. <index referenceId="EAV_ENTITY_STORE_ENTITY_TYPE_ID" indexType="btree">
  327. <column name="entity_type_id"/>
  328. </index>
  329. <index referenceId="EAV_ENTITY_STORE_STORE_ID" indexType="btree">
  330. <column name="store_id"/>
  331. </index>
  332. </table>
  333. <table name="eav_attribute_set" resource="default" engine="innodb" comment="Eav Attribute Set">
  334. <column xsi:type="smallint" name="attribute_set_id" padding="5" unsigned="true" nullable="false" identity="true"
  335. comment="Attribute Set Id"/>
  336. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  337. default="0" comment="Entity Type Id"/>
  338. <column xsi:type="varchar" name="attribute_set_name" nullable="true" length="255" comment="Attribute Set Name"/>
  339. <column xsi:type="smallint" name="sort_order" padding="6" unsigned="false" nullable="false" identity="false"
  340. default="0" comment="Sort Order"/>
  341. <constraint xsi:type="primary" referenceId="PRIMARY">
  342. <column name="attribute_set_id"/>
  343. </constraint>
  344. <constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID"
  345. table="eav_attribute_set" column="entity_type_id" referenceTable="eav_entity_type"
  346. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  347. <constraint xsi:type="unique" referenceId="EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME">
  348. <column name="entity_type_id"/>
  349. <column name="attribute_set_name"/>
  350. </constraint>
  351. <index referenceId="EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_SORT_ORDER" indexType="btree">
  352. <column name="entity_type_id"/>
  353. <column name="sort_order"/>
  354. </index>
  355. </table>
  356. <table name="eav_attribute_group" resource="default" engine="innodb" comment="Eav Attribute Group">
  357. <column xsi:type="smallint" name="attribute_group_id" padding="5" unsigned="true" nullable="false"
  358. identity="true" comment="Attribute Group Id"/>
  359. <column xsi:type="smallint" name="attribute_set_id" padding="5" unsigned="true" nullable="false"
  360. identity="false" default="0" comment="Attribute Set Id"/>
  361. <column xsi:type="varchar" name="attribute_group_name" nullable="true" length="255"
  362. comment="Attribute Group Name"/>
  363. <column xsi:type="smallint" name="sort_order" padding="6" unsigned="false" nullable="false" identity="false"
  364. default="0" comment="Sort Order"/>
  365. <column xsi:type="smallint" name="default_id" padding="5" unsigned="true" nullable="true" identity="false"
  366. default="0" comment="Default Id"/>
  367. <column xsi:type="varchar" name="attribute_group_code" nullable="false" length="255"
  368. comment="Attribute Group Code"/>
  369. <column xsi:type="varchar" name="tab_group_code" nullable="true" length="255" comment="Tab Group Code"/>
  370. <constraint xsi:type="primary" referenceId="PRIMARY">
  371. <column name="attribute_group_id"/>
  372. </constraint>
  373. <constraint xsi:type="foreign" referenceId="EAV_ATTR_GROUP_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID"
  374. table="eav_attribute_group" column="attribute_set_id" referenceTable="eav_attribute_set"
  375. referenceColumn="attribute_set_id" onDelete="CASCADE"/>
  376. <constraint xsi:type="unique" referenceId="EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME">
  377. <column name="attribute_set_id"/>
  378. <column name="attribute_group_name"/>
  379. </constraint>
  380. <constraint xsi:type="unique" referenceId="EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE">
  381. <column name="attribute_set_id"/>
  382. <column name="attribute_group_code"/>
  383. </constraint>
  384. <index referenceId="EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_SORT_ORDER" indexType="btree">
  385. <column name="attribute_set_id"/>
  386. <column name="sort_order"/>
  387. </index>
  388. </table>
  389. <table name="eav_entity_attribute" resource="default" engine="innodb" comment="Eav Entity Attributes">
  390. <column xsi:type="int" name="entity_attribute_id" padding="10" unsigned="true" nullable="false" identity="true"
  391. comment="Entity Attribute Id"/>
  392. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  393. default="0" comment="Entity Type Id"/>
  394. <column xsi:type="smallint" name="attribute_set_id" padding="5" unsigned="true" nullable="false"
  395. identity="false" default="0" comment="Attribute Set Id"/>
  396. <column xsi:type="smallint" name="attribute_group_id" padding="5" unsigned="true" nullable="false"
  397. identity="false" default="0" comment="Attribute Group Id"/>
  398. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  399. default="0" comment="Attribute Id"/>
  400. <column xsi:type="smallint" name="sort_order" padding="6" unsigned="false" nullable="false" identity="false"
  401. default="0" comment="Sort Order"/>
  402. <constraint xsi:type="primary" referenceId="PRIMARY">
  403. <column name="entity_attribute_id"/>
  404. </constraint>
  405. <constraint xsi:type="foreign" referenceId="EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  406. table="eav_entity_attribute" column="attribute_id" referenceTable="eav_attribute"
  407. referenceColumn="attribute_id" onDelete="CASCADE"/>
  408. <constraint xsi:type="foreign" referenceId="EAV_ENTT_ATTR_ATTR_GROUP_ID_EAV_ATTR_GROUP_ATTR_GROUP_ID"
  409. table="eav_entity_attribute" column="attribute_group_id" referenceTable="eav_attribute_group"
  410. referenceColumn="attribute_group_id" onDelete="CASCADE"/>
  411. <constraint xsi:type="unique" referenceId="EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID">
  412. <column name="attribute_set_id"/>
  413. <column name="attribute_id"/>
  414. </constraint>
  415. <constraint xsi:type="unique" referenceId="EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_GROUP_ID_ATTRIBUTE_ID">
  416. <column name="attribute_group_id"/>
  417. <column name="attribute_id"/>
  418. </constraint>
  419. <index referenceId="EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_SORT_ORDER" indexType="btree">
  420. <column name="attribute_set_id"/>
  421. <column name="sort_order"/>
  422. </index>
  423. <index referenceId="EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID" indexType="btree">
  424. <column name="attribute_id"/>
  425. </index>
  426. </table>
  427. <table name="eav_attribute_option" resource="default" engine="innodb" comment="Eav Attribute Option">
  428. <column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="true"
  429. comment="Option Id"/>
  430. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  431. default="0" comment="Attribute Id"/>
  432. <column xsi:type="smallint" name="sort_order" padding="5" unsigned="true" nullable="false" identity="false"
  433. default="0" comment="Sort Order"/>
  434. <constraint xsi:type="primary" referenceId="PRIMARY">
  435. <column name="option_id"/>
  436. </constraint>
  437. <constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_OPTION_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  438. table="eav_attribute_option" column="attribute_id" referenceTable="eav_attribute"
  439. referenceColumn="attribute_id" onDelete="CASCADE"/>
  440. <index referenceId="EAV_ATTRIBUTE_OPTION_ATTRIBUTE_ID" indexType="btree">
  441. <column name="attribute_id"/>
  442. </index>
  443. </table>
  444. <table name="eav_attribute_option_value" resource="default" engine="innodb" comment="Eav Attribute Option Value">
  445. <column xsi:type="int" name="value_id" padding="10" unsigned="true" nullable="false" identity="true"
  446. comment="Value Id"/>
  447. <column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="false"
  448. default="0" comment="Option Id"/>
  449. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  450. default="0" comment="Store Id"/>
  451. <column xsi:type="varchar" name="value" nullable="true" length="255" comment="Value"/>
  452. <constraint xsi:type="primary" referenceId="PRIMARY">
  453. <column name="value_id"/>
  454. </constraint>
  455. <constraint xsi:type="foreign" referenceId="EAV_ATTR_OPT_VAL_OPT_ID_EAV_ATTR_OPT_OPT_ID"
  456. table="eav_attribute_option_value" column="option_id" referenceTable="eav_attribute_option"
  457. referenceColumn="option_id" onDelete="CASCADE"/>
  458. <constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID"
  459. table="eav_attribute_option_value" column="store_id" referenceTable="store"
  460. referenceColumn="store_id" onDelete="CASCADE"/>
  461. <index referenceId="EAV_ATTRIBUTE_OPTION_VALUE_OPTION_ID" indexType="btree">
  462. <column name="option_id"/>
  463. </index>
  464. <index referenceId="EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID" indexType="btree">
  465. <column name="store_id"/>
  466. </index>
  467. </table>
  468. <table name="eav_attribute_label" resource="default" engine="innodb" comment="Eav Attribute Label">
  469. <column xsi:type="int" name="attribute_label_id" padding="10" unsigned="true" nullable="false" identity="true"
  470. comment="Attribute Label Id"/>
  471. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  472. default="0" comment="Attribute Id"/>
  473. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  474. default="0" comment="Store Id"/>
  475. <column xsi:type="varchar" name="value" nullable="true" length="255" comment="Value"/>
  476. <constraint xsi:type="primary" referenceId="PRIMARY">
  477. <column name="attribute_label_id"/>
  478. </constraint>
  479. <constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_LABEL_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  480. table="eav_attribute_label" column="attribute_id" referenceTable="eav_attribute"
  481. referenceColumn="attribute_id" onDelete="CASCADE"/>
  482. <constraint xsi:type="foreign" referenceId="EAV_ATTRIBUTE_LABEL_STORE_ID_STORE_STORE_ID" table="eav_attribute_label"
  483. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  484. <index referenceId="EAV_ATTRIBUTE_LABEL_STORE_ID" indexType="btree">
  485. <column name="store_id"/>
  486. </index>
  487. <index referenceId="EAV_ATTRIBUTE_LABEL_ATTRIBUTE_ID_STORE_ID" indexType="btree">
  488. <column name="attribute_id"/>
  489. <column name="store_id"/>
  490. </index>
  491. </table>
  492. <table name="eav_form_type" resource="default" engine="innodb" comment="Eav Form Type">
  493. <column xsi:type="smallint" name="type_id" padding="5" unsigned="true" nullable="false" identity="true"
  494. comment="Type Id"/>
  495. <column xsi:type="varchar" name="code" nullable="false" length="64" comment="Code"/>
  496. <column xsi:type="varchar" name="label" nullable="false" length="255" comment="Label"/>
  497. <column xsi:type="smallint" name="is_system" padding="5" unsigned="true" nullable="false" identity="false"
  498. default="0" comment="Is System"/>
  499. <column xsi:type="varchar" name="theme" nullable="true" length="64" comment="Theme"/>
  500. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  501. comment="Store Id"/>
  502. <constraint xsi:type="primary" referenceId="PRIMARY">
  503. <column name="type_id"/>
  504. </constraint>
  505. <constraint xsi:type="foreign" referenceId="EAV_FORM_TYPE_STORE_ID_STORE_STORE_ID" table="eav_form_type"
  506. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  507. <constraint xsi:type="unique" referenceId="EAV_FORM_TYPE_CODE_THEME_STORE_ID">
  508. <column name="code"/>
  509. <column name="theme"/>
  510. <column name="store_id"/>
  511. </constraint>
  512. <index referenceId="EAV_FORM_TYPE_STORE_ID" indexType="btree">
  513. <column name="store_id"/>
  514. </index>
  515. </table>
  516. <table name="eav_form_type_entity" resource="default" engine="innodb" comment="Eav Form Type Entity">
  517. <column xsi:type="smallint" name="type_id" padding="5" unsigned="true" nullable="false" identity="false"
  518. comment="Type Id"/>
  519. <column xsi:type="smallint" name="entity_type_id" padding="5" unsigned="true" nullable="false" identity="false"
  520. comment="Entity Type Id"/>
  521. <constraint xsi:type="primary" referenceId="PRIMARY">
  522. <column name="type_id"/>
  523. <column name="entity_type_id"/>
  524. </constraint>
  525. <constraint xsi:type="foreign" referenceId="EAV_FORM_TYPE_ENTT_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID"
  526. table="eav_form_type_entity" column="entity_type_id" referenceTable="eav_entity_type"
  527. referenceColumn="entity_type_id" onDelete="CASCADE"/>
  528. <constraint xsi:type="foreign" referenceId="EAV_FORM_TYPE_ENTITY_TYPE_ID_EAV_FORM_TYPE_TYPE_ID"
  529. table="eav_form_type_entity" column="type_id" referenceTable="eav_form_type"
  530. referenceColumn="type_id" onDelete="CASCADE"/>
  531. <index referenceId="EAV_FORM_TYPE_ENTITY_ENTITY_TYPE_ID" indexType="btree">
  532. <column name="entity_type_id"/>
  533. </index>
  534. </table>
  535. <table name="eav_form_fieldset" resource="default" engine="innodb" comment="Eav Form Fieldset">
  536. <column xsi:type="smallint" name="fieldset_id" padding="5" unsigned="true" nullable="false" identity="true"
  537. comment="Fieldset Id"/>
  538. <column xsi:type="smallint" name="type_id" padding="5" unsigned="true" nullable="false" identity="false"
  539. comment="Type Id"/>
  540. <column xsi:type="varchar" name="code" nullable="false" length="64" comment="Code"/>
  541. <column xsi:type="int" name="sort_order" padding="11" unsigned="false" nullable="false" identity="false"
  542. default="0" comment="Sort Order"/>
  543. <constraint xsi:type="primary" referenceId="PRIMARY">
  544. <column name="fieldset_id"/>
  545. </constraint>
  546. <constraint xsi:type="foreign" referenceId="EAV_FORM_FIELDSET_TYPE_ID_EAV_FORM_TYPE_TYPE_ID" table="eav_form_fieldset"
  547. column="type_id" referenceTable="eav_form_type" referenceColumn="type_id" onDelete="CASCADE"/>
  548. <constraint xsi:type="unique" referenceId="EAV_FORM_FIELDSET_TYPE_ID_CODE">
  549. <column name="type_id"/>
  550. <column name="code"/>
  551. </constraint>
  552. </table>
  553. <table name="eav_form_fieldset_label" resource="default" engine="innodb" comment="Eav Form Fieldset Label">
  554. <column xsi:type="smallint" name="fieldset_id" padding="5" unsigned="true" nullable="false" identity="false"
  555. comment="Fieldset Id"/>
  556. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  557. comment="Store Id"/>
  558. <column xsi:type="varchar" name="label" nullable="false" length="255" comment="Label"/>
  559. <constraint xsi:type="primary" referenceId="PRIMARY">
  560. <column name="fieldset_id"/>
  561. <column name="store_id"/>
  562. </constraint>
  563. <constraint xsi:type="foreign" referenceId="EAV_FORM_FSET_LBL_FSET_ID_EAV_FORM_FSET_FSET_ID"
  564. table="eav_form_fieldset_label" column="fieldset_id" referenceTable="eav_form_fieldset"
  565. referenceColumn="fieldset_id" onDelete="CASCADE"/>
  566. <constraint xsi:type="foreign" referenceId="EAV_FORM_FIELDSET_LABEL_STORE_ID_STORE_STORE_ID"
  567. table="eav_form_fieldset_label" column="store_id" referenceTable="store" referenceColumn="store_id"
  568. onDelete="CASCADE"/>
  569. <index referenceId="EAV_FORM_FIELDSET_LABEL_STORE_ID" indexType="btree">
  570. <column name="store_id"/>
  571. </index>
  572. </table>
  573. <table name="eav_form_element" resource="default" engine="innodb" comment="Eav Form Element">
  574. <column xsi:type="int" name="element_id" padding="10" unsigned="true" nullable="false" identity="true"
  575. comment="Element Id"/>
  576. <column xsi:type="smallint" name="type_id" padding="5" unsigned="true" nullable="false" identity="false"
  577. comment="Type Id"/>
  578. <column xsi:type="smallint" name="fieldset_id" padding="5" unsigned="true" nullable="true" identity="false"
  579. comment="Fieldset Id"/>
  580. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  581. comment="Attribute Id"/>
  582. <column xsi:type="int" name="sort_order" padding="11" unsigned="false" nullable="false" identity="false"
  583. default="0" comment="Sort Order"/>
  584. <constraint xsi:type="primary" referenceId="PRIMARY">
  585. <column name="element_id"/>
  586. </constraint>
  587. <constraint xsi:type="foreign" referenceId="EAV_FORM_ELEMENT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  588. table="eav_form_element" column="attribute_id" referenceTable="eav_attribute"
  589. referenceColumn="attribute_id" onDelete="CASCADE"/>
  590. <constraint xsi:type="foreign" referenceId="EAV_FORM_ELEMENT_FIELDSET_ID_EAV_FORM_FIELDSET_FIELDSET_ID"
  591. table="eav_form_element" column="fieldset_id" referenceTable="eav_form_fieldset"
  592. referenceColumn="fieldset_id" onDelete="SET NULL"/>
  593. <constraint xsi:type="foreign" referenceId="EAV_FORM_ELEMENT_TYPE_ID_EAV_FORM_TYPE_TYPE_ID" table="eav_form_element"
  594. column="type_id" referenceTable="eav_form_type" referenceColumn="type_id" onDelete="CASCADE"/>
  595. <constraint xsi:type="unique" referenceId="EAV_FORM_ELEMENT_TYPE_ID_ATTRIBUTE_ID">
  596. <column name="type_id"/>
  597. <column name="attribute_id"/>
  598. </constraint>
  599. <index referenceId="EAV_FORM_ELEMENT_FIELDSET_ID" indexType="btree">
  600. <column name="fieldset_id"/>
  601. </index>
  602. <index referenceId="EAV_FORM_ELEMENT_ATTRIBUTE_ID" indexType="btree">
  603. <column name="attribute_id"/>
  604. </index>
  605. </table>
  606. </schema>