db_schema.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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="customer_entity" resource="default" engine="innodb" comment="Customer Entity">
  11. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Entity ID"/>
  13. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="true" identity="false"
  14. comment="Website ID"/>
  15. <column xsi:type="varchar" name="email" nullable="true" length="255" comment="Email"/>
  16. <column xsi:type="smallint" name="group_id" padding="5" unsigned="true" nullable="false" identity="false"
  17. default="0" comment="Group ID"/>
  18. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment Id"/>
  19. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
  20. default="0" comment="Store ID"/>
  21. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  22. comment="Created At"/>
  23. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  24. comment="Updated At"/>
  25. <column xsi:type="smallint" name="is_active" padding="5" unsigned="true" nullable="false" identity="false"
  26. default="1" comment="Is Active"/>
  27. <column xsi:type="smallint" name="disable_auto_group_change" padding="5" unsigned="true" nullable="false"
  28. identity="false" default="0" comment="Disable automatic group change based on VAT ID"/>
  29. <column xsi:type="varchar" name="created_in" nullable="true" length="255" comment="Created From"/>
  30. <column xsi:type="varchar" name="prefix" nullable="true" length="40" comment="Name Prefix"/>
  31. <column xsi:type="varchar" name="firstname" nullable="true" length="255" comment="First Name"/>
  32. <column xsi:type="varchar" name="middlename" nullable="true" length="255" comment="Middle Name/Initial"/>
  33. <column xsi:type="varchar" name="lastname" nullable="true" length="255" comment="Last Name"/>
  34. <column xsi:type="varchar" name="suffix" nullable="true" length="40" comment="Name Suffix"/>
  35. <column xsi:type="date" name="dob" comment="Date of Birth"/>
  36. <column xsi:type="varchar" name="password_hash" nullable="true" length="128" comment="Password_hash"/>
  37. <column xsi:type="varchar" name="rp_token" nullable="true" length="128" comment="Reset password token"/>
  38. <column xsi:type="datetime" name="rp_token_created_at" on_update="false" nullable="true"
  39. comment="Reset password token creation time"/>
  40. <column xsi:type="int" name="default_billing" padding="10" unsigned="true" nullable="true" identity="false"
  41. comment="Default Billing Address"/>
  42. <column xsi:type="int" name="default_shipping" padding="10" unsigned="true" nullable="true" identity="false"
  43. comment="Default Shipping Address"/>
  44. <column xsi:type="varchar" name="taxvat" nullable="true" length="50" comment="Tax/VAT Number"/>
  45. <column xsi:type="varchar" name="confirmation" nullable="true" length="64" comment="Is Confirmed"/>
  46. <column xsi:type="smallint" name="gender" padding="5" unsigned="true" nullable="true" identity="false"
  47. comment="Gender"/>
  48. <column xsi:type="smallint" name="failures_num" padding="6" unsigned="false" nullable="true" identity="false"
  49. default="0" comment="Failure Number"/>
  50. <column xsi:type="timestamp" name="first_failure" on_update="false" nullable="true" comment="First Failure"/>
  51. <column xsi:type="timestamp" name="lock_expires" on_update="false" nullable="true"
  52. comment="Lock Expiration Date"/>
  53. <constraint xsi:type="primary" referenceId="PRIMARY">
  54. <column name="entity_id"/>
  55. </constraint>
  56. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_STORE_ID_STORE_STORE_ID" table="customer_entity"
  57. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  58. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID"
  59. table="customer_entity" column="website_id" referenceTable="store_website"
  60. referenceColumn="website_id" onDelete="SET NULL"/>
  61. <constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_EMAIL_WEBSITE_ID">
  62. <column name="email"/>
  63. <column name="website_id"/>
  64. </constraint>
  65. <index referenceId="CUSTOMER_ENTITY_STORE_ID" indexType="btree">
  66. <column name="store_id"/>
  67. </index>
  68. <index referenceId="CUSTOMER_ENTITY_WEBSITE_ID" indexType="btree">
  69. <column name="website_id"/>
  70. </index>
  71. <index referenceId="CUSTOMER_ENTITY_FIRSTNAME" indexType="btree">
  72. <column name="firstname"/>
  73. </index>
  74. <index referenceId="CUSTOMER_ENTITY_LASTNAME" indexType="btree">
  75. <column name="lastname"/>
  76. </index>
  77. </table>
  78. <table name="customer_address_entity" resource="default" engine="innodb" comment="Customer Address Entity">
  79. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"
  80. comment="Entity ID"/>
  81. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment Id"/>
  82. <column xsi:type="int" name="parent_id" padding="10" unsigned="true" nullable="true" identity="false"
  83. comment="Parent ID"/>
  84. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  85. comment="Created At"/>
  86. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  87. comment="Updated At"/>
  88. <column xsi:type="smallint" name="is_active" padding="5" unsigned="true" nullable="false" identity="false"
  89. default="1" comment="Is Active"/>
  90. <column xsi:type="varchar" name="city" nullable="false" length="255" comment="City"/>
  91. <column xsi:type="varchar" name="company" nullable="true" length="255" comment="Company"/>
  92. <column xsi:type="varchar" name="country_id" nullable="false" length="255" comment="Country"/>
  93. <column xsi:type="varchar" name="fax" nullable="true" length="255" comment="Fax"/>
  94. <column xsi:type="varchar" name="firstname" nullable="false" length="255" comment="First Name"/>
  95. <column xsi:type="varchar" name="lastname" nullable="false" length="255" comment="Last Name"/>
  96. <column xsi:type="varchar" name="middlename" nullable="true" length="255" comment="Middle Name"/>
  97. <column xsi:type="varchar" name="postcode" nullable="true" length="255" comment="Zip/Postal Code"/>
  98. <column xsi:type="varchar" name="prefix" nullable="true" length="40" comment="Name Prefix"/>
  99. <column xsi:type="varchar" name="region" nullable="true" length="255" comment="State/Province"/>
  100. <column xsi:type="int" name="region_id" padding="10" unsigned="true" nullable="true" identity="false"
  101. comment="State/Province"/>
  102. <column xsi:type="text" name="street" nullable="false" comment="Street Address"/>
  103. <column xsi:type="varchar" name="suffix" nullable="true" length="40" comment="Name Suffix"/>
  104. <column xsi:type="varchar" name="telephone" nullable="false" length="255" comment="Phone Number"/>
  105. <column xsi:type="varchar" name="vat_id" nullable="true" length="255" comment="VAT number"/>
  106. <column xsi:type="int" name="vat_is_valid" padding="10" unsigned="true" nullable="true" identity="false"
  107. comment="VAT number validity"/>
  108. <column xsi:type="varchar" name="vat_request_date" nullable="true" length="255"
  109. comment="VAT number validation request date"/>
  110. <column xsi:type="varchar" name="vat_request_id" nullable="true" length="255"
  111. comment="VAT number validation request ID"/>
  112. <column xsi:type="int" name="vat_request_success" padding="10" unsigned="true" nullable="true" identity="false"
  113. comment="VAT number validation request success"/>
  114. <constraint xsi:type="primary" referenceId="PRIMARY">
  115. <column name="entity_id"/>
  116. </constraint>
  117. <constraint xsi:type="foreign" referenceId="CUSTOMER_ADDRESS_ENTITY_PARENT_ID_CUSTOMER_ENTITY_ENTITY_ID"
  118. table="customer_address_entity" column="parent_id" referenceTable="customer_entity"
  119. referenceColumn="entity_id" onDelete="CASCADE"/>
  120. <index referenceId="CUSTOMER_ADDRESS_ENTITY_PARENT_ID" indexType="btree">
  121. <column name="parent_id"/>
  122. </index>
  123. </table>
  124. <table name="customer_address_entity_datetime" resource="default" engine="innodb"
  125. comment="Customer Address Entity Datetime">
  126. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  127. comment="Value Id"/>
  128. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  129. default="0" comment="Attribute Id"/>
  130. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  131. default="0" comment="Entity ID"/>
  132. <column xsi:type="datetime" name="value" on_update="false" nullable="true" comment="Value"/>
  133. <constraint xsi:type="primary" referenceId="PRIMARY">
  134. <column name="value_id"/>
  135. </constraint>
  136. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID"
  137. table="customer_address_entity_datetime" column="attribute_id" referenceTable="eav_attribute"
  138. referenceColumn="attribute_id" onDelete="CASCADE"/>
  139. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_DTIME_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID"
  140. table="customer_address_entity_datetime" column="entity_id" referenceTable="customer_address_entity"
  141. referenceColumn="entity_id" onDelete="CASCADE"/>
  142. <constraint xsi:type="unique" referenceId="CUSTOMER_ADDRESS_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID">
  143. <column name="entity_id"/>
  144. <column name="attribute_id"/>
  145. </constraint>
  146. <index referenceId="CUSTOMER_ADDRESS_ENTITY_DATETIME_ATTRIBUTE_ID" indexType="btree">
  147. <column name="attribute_id"/>
  148. </index>
  149. <index referenceId="CUSTOMER_ADDRESS_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  150. <column name="entity_id"/>
  151. <column name="attribute_id"/>
  152. <column name="value"/>
  153. </index>
  154. </table>
  155. <table name="customer_address_entity_decimal" resource="default" engine="innodb"
  156. comment="Customer Address Entity Decimal">
  157. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  158. comment="Value Id"/>
  159. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  160. default="0" comment="Attribute Id"/>
  161. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  162. default="0" comment="Entity ID"/>
  163. <column xsi:type="decimal" name="value" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  164. comment="Value"/>
  165. <constraint xsi:type="primary" referenceId="PRIMARY">
  166. <column name="value_id"/>
  167. </constraint>
  168. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID"
  169. table="customer_address_entity_decimal" column="attribute_id" referenceTable="eav_attribute"
  170. referenceColumn="attribute_id" onDelete="CASCADE"/>
  171. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_DEC_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID"
  172. table="customer_address_entity_decimal" column="entity_id" referenceTable="customer_address_entity"
  173. referenceColumn="entity_id" onDelete="CASCADE"/>
  174. <constraint xsi:type="unique" referenceId="CUSTOMER_ADDRESS_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID">
  175. <column name="entity_id"/>
  176. <column name="attribute_id"/>
  177. </constraint>
  178. <index referenceId="CUSTOMER_ADDRESS_ENTITY_DECIMAL_ATTRIBUTE_ID" indexType="btree">
  179. <column name="attribute_id"/>
  180. </index>
  181. <index referenceId="CUSTOMER_ADDRESS_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  182. <column name="entity_id"/>
  183. <column name="attribute_id"/>
  184. <column name="value"/>
  185. </index>
  186. </table>
  187. <table name="customer_address_entity_int" resource="default" engine="innodb" comment="Customer Address Entity Int">
  188. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  189. comment="Value ID"/>
  190. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  191. default="0" comment="Attribute ID"/>
  192. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  193. default="0" comment="Entity ID"/>
  194. <column xsi:type="int" name="value" padding="11" unsigned="false" nullable="false" identity="false" default="0"
  195. comment="Value"/>
  196. <constraint xsi:type="primary" referenceId="PRIMARY">
  197. <column name="value_id"/>
  198. </constraint>
  199. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID"
  200. table="customer_address_entity_int" column="attribute_id" referenceTable="eav_attribute"
  201. referenceColumn="attribute_id" onDelete="CASCADE"/>
  202. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_INT_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID"
  203. table="customer_address_entity_int" column="entity_id" referenceTable="customer_address_entity"
  204. referenceColumn="entity_id" onDelete="CASCADE"/>
  205. <constraint xsi:type="unique" referenceId="CUSTOMER_ADDRESS_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID">
  206. <column name="entity_id"/>
  207. <column name="attribute_id"/>
  208. </constraint>
  209. <index referenceId="CUSTOMER_ADDRESS_ENTITY_INT_ATTRIBUTE_ID" indexType="btree">
  210. <column name="attribute_id"/>
  211. </index>
  212. <index referenceId="CUSTOMER_ADDRESS_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  213. <column name="entity_id"/>
  214. <column name="attribute_id"/>
  215. <column name="value"/>
  216. </index>
  217. </table>
  218. <table name="customer_address_entity_text" resource="default" engine="innodb"
  219. comment="Customer Address Entity Text">
  220. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  221. comment="Value ID"/>
  222. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  223. default="0" comment="Attribute ID"/>
  224. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  225. default="0" comment="Entity ID"/>
  226. <column xsi:type="text" name="value" nullable="false" comment="Value"/>
  227. <constraint xsi:type="primary" referenceId="PRIMARY">
  228. <column name="value_id"/>
  229. </constraint>
  230. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID"
  231. table="customer_address_entity_text" column="attribute_id" referenceTable="eav_attribute"
  232. referenceColumn="attribute_id" onDelete="CASCADE"/>
  233. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_TEXT_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID"
  234. table="customer_address_entity_text" column="entity_id" referenceTable="customer_address_entity"
  235. referenceColumn="entity_id" onDelete="CASCADE"/>
  236. <constraint xsi:type="unique" referenceId="CUSTOMER_ADDRESS_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID">
  237. <column name="entity_id"/>
  238. <column name="attribute_id"/>
  239. </constraint>
  240. <index referenceId="CUSTOMER_ADDRESS_ENTITY_TEXT_ATTRIBUTE_ID" indexType="btree">
  241. <column name="attribute_id"/>
  242. </index>
  243. </table>
  244. <table name="customer_address_entity_varchar" resource="default" engine="innodb"
  245. comment="Customer Address Entity Varchar">
  246. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  247. comment="Value ID"/>
  248. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  249. default="0" comment="Attribute ID"/>
  250. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  251. default="0" comment="Entity ID"/>
  252. <column xsi:type="varchar" name="value" nullable="true" length="255" comment="Value"/>
  253. <constraint xsi:type="primary" referenceId="PRIMARY">
  254. <column name="value_id"/>
  255. </constraint>
  256. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID"
  257. table="customer_address_entity_varchar" column="attribute_id" referenceTable="eav_attribute"
  258. referenceColumn="attribute_id" onDelete="CASCADE"/>
  259. <constraint xsi:type="foreign" referenceId="CSTR_ADDR_ENTT_VCHR_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID"
  260. table="customer_address_entity_varchar" column="entity_id" referenceTable="customer_address_entity"
  261. referenceColumn="entity_id" onDelete="CASCADE"/>
  262. <constraint xsi:type="unique" referenceId="CUSTOMER_ADDRESS_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID">
  263. <column name="entity_id"/>
  264. <column name="attribute_id"/>
  265. </constraint>
  266. <index referenceId="CUSTOMER_ADDRESS_ENTITY_VARCHAR_ATTRIBUTE_ID" indexType="btree">
  267. <column name="attribute_id"/>
  268. </index>
  269. <index referenceId="CUSTOMER_ADDRESS_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  270. <column name="entity_id"/>
  271. <column name="attribute_id"/>
  272. <column name="value"/>
  273. </index>
  274. </table>
  275. <table name="customer_entity_datetime" resource="default" engine="innodb" comment="Customer Entity Datetime">
  276. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  277. comment="Value ID"/>
  278. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  279. default="0" comment="Attribute ID"/>
  280. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  281. default="0" comment="Entity ID"/>
  282. <column xsi:type="datetime" name="value" on_update="false" nullable="true" comment="Value"/>
  283. <constraint xsi:type="primary" referenceId="PRIMARY">
  284. <column name="value_id"/>
  285. </constraint>
  286. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_DATETIME_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  287. table="customer_entity_datetime" column="attribute_id" referenceTable="eav_attribute"
  288. referenceColumn="attribute_id" onDelete="CASCADE"/>
  289. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_DATETIME_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID"
  290. table="customer_entity_datetime" column="entity_id" referenceTable="customer_entity"
  291. referenceColumn="entity_id" onDelete="CASCADE"/>
  292. <constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID">
  293. <column name="entity_id"/>
  294. <column name="attribute_id"/>
  295. </constraint>
  296. <index referenceId="CUSTOMER_ENTITY_DATETIME_ATTRIBUTE_ID" indexType="btree">
  297. <column name="attribute_id"/>
  298. </index>
  299. <index referenceId="CUSTOMER_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  300. <column name="entity_id"/>
  301. <column name="attribute_id"/>
  302. <column name="value"/>
  303. </index>
  304. </table>
  305. <table name="customer_entity_decimal" resource="default" engine="innodb" comment="Customer Entity Decimal">
  306. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  307. comment="Value ID"/>
  308. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  309. default="0" comment="Attribute ID"/>
  310. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  311. default="0" comment="Entity ID"/>
  312. <column xsi:type="decimal" name="value" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  313. comment="Value"/>
  314. <constraint xsi:type="primary" referenceId="PRIMARY">
  315. <column name="value_id"/>
  316. </constraint>
  317. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_DECIMAL_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  318. table="customer_entity_decimal" column="attribute_id" referenceTable="eav_attribute"
  319. referenceColumn="attribute_id" onDelete="CASCADE"/>
  320. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_DECIMAL_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID"
  321. table="customer_entity_decimal" column="entity_id" referenceTable="customer_entity"
  322. referenceColumn="entity_id" onDelete="CASCADE"/>
  323. <constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID">
  324. <column name="entity_id"/>
  325. <column name="attribute_id"/>
  326. </constraint>
  327. <index referenceId="CUSTOMER_ENTITY_DECIMAL_ATTRIBUTE_ID" indexType="btree">
  328. <column name="attribute_id"/>
  329. </index>
  330. <index referenceId="CUSTOMER_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  331. <column name="entity_id"/>
  332. <column name="attribute_id"/>
  333. <column name="value"/>
  334. </index>
  335. </table>
  336. <table name="customer_entity_int" resource="default" engine="innodb" comment="Customer Entity Int">
  337. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  338. comment="Value ID"/>
  339. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  340. default="0" comment="Attribute ID"/>
  341. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  342. default="0" comment="Entity ID"/>
  343. <column xsi:type="int" name="value" padding="11" unsigned="false" nullable="false" identity="false" default="0"
  344. comment="Value"/>
  345. <constraint xsi:type="primary" referenceId="PRIMARY">
  346. <column name="value_id"/>
  347. </constraint>
  348. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_INT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  349. table="customer_entity_int" column="attribute_id" referenceTable="eav_attribute"
  350. referenceColumn="attribute_id" onDelete="CASCADE"/>
  351. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_INT_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID"
  352. table="customer_entity_int" column="entity_id" referenceTable="customer_entity"
  353. referenceColumn="entity_id" onDelete="CASCADE"/>
  354. <constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID">
  355. <column name="entity_id"/>
  356. <column name="attribute_id"/>
  357. </constraint>
  358. <index referenceId="CUSTOMER_ENTITY_INT_ATTRIBUTE_ID" indexType="btree">
  359. <column name="attribute_id"/>
  360. </index>
  361. <index referenceId="CUSTOMER_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  362. <column name="entity_id"/>
  363. <column name="attribute_id"/>
  364. <column name="value"/>
  365. </index>
  366. </table>
  367. <table name="customer_entity_text" resource="default" engine="innodb" comment="Customer Entity Text">
  368. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  369. comment="Value ID"/>
  370. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  371. default="0" comment="Attribute ID"/>
  372. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  373. default="0" comment="Entity ID"/>
  374. <column xsi:type="text" name="value" nullable="false" comment="Value"/>
  375. <constraint xsi:type="primary" referenceId="PRIMARY">
  376. <column name="value_id"/>
  377. </constraint>
  378. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_TEXT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  379. table="customer_entity_text" column="attribute_id" referenceTable="eav_attribute"
  380. referenceColumn="attribute_id" onDelete="CASCADE"/>
  381. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_TEXT_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID"
  382. table="customer_entity_text" column="entity_id" referenceTable="customer_entity"
  383. referenceColumn="entity_id" onDelete="CASCADE"/>
  384. <constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID">
  385. <column name="entity_id"/>
  386. <column name="attribute_id"/>
  387. </constraint>
  388. <index referenceId="CUSTOMER_ENTITY_TEXT_ATTRIBUTE_ID" indexType="btree">
  389. <column name="attribute_id"/>
  390. </index>
  391. </table>
  392. <table name="customer_entity_varchar" resource="default" engine="innodb" comment="Customer Entity Varchar">
  393. <column xsi:type="int" name="value_id" padding="11" unsigned="false" nullable="false" identity="true"
  394. comment="Value ID"/>
  395. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  396. default="0" comment="Attribute ID"/>
  397. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="false"
  398. default="0" comment="Entity ID"/>
  399. <column xsi:type="varchar" name="value" nullable="true" length="255" comment="Value"/>
  400. <constraint xsi:type="primary" referenceId="PRIMARY">
  401. <column name="value_id"/>
  402. </constraint>
  403. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_VARCHAR_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  404. table="customer_entity_varchar" column="attribute_id" referenceTable="eav_attribute"
  405. referenceColumn="attribute_id" onDelete="CASCADE"/>
  406. <constraint xsi:type="foreign" referenceId="CUSTOMER_ENTITY_VARCHAR_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID"
  407. table="customer_entity_varchar" column="entity_id" referenceTable="customer_entity"
  408. referenceColumn="entity_id" onDelete="CASCADE"/>
  409. <constraint xsi:type="unique" referenceId="CUSTOMER_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID">
  410. <column name="entity_id"/>
  411. <column name="attribute_id"/>
  412. </constraint>
  413. <index referenceId="CUSTOMER_ENTITY_VARCHAR_ATTRIBUTE_ID" indexType="btree">
  414. <column name="attribute_id"/>
  415. </index>
  416. <index referenceId="CUSTOMER_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_VALUE" indexType="btree">
  417. <column name="entity_id"/>
  418. <column name="attribute_id"/>
  419. <column name="value"/>
  420. </index>
  421. </table>
  422. <table name="customer_group" resource="default" engine="innodb" comment="Customer Group">
  423. <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="false" identity="true"/>
  424. <column xsi:type="varchar" name="customer_group_code" nullable="false" length="32"
  425. comment="Customer Group Code"/>
  426. <column xsi:type="int" name="tax_class_id" padding="10" unsigned="true" nullable="false" identity="false"
  427. default="0" comment="Tax Class Id"/>
  428. <constraint xsi:type="primary" referenceId="PRIMARY">
  429. <column name="customer_group_id"/>
  430. </constraint>
  431. </table>
  432. <table name="customer_eav_attribute" resource="default" engine="innodb" comment="Customer Eav Attribute">
  433. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  434. comment="Attribute Id"/>
  435. <column xsi:type="smallint" name="is_visible" padding="5" unsigned="true" nullable="false" identity="false"
  436. default="1" comment="Is Visible"/>
  437. <column xsi:type="varchar" name="input_filter" nullable="true" length="255" comment="Input Filter"/>
  438. <column xsi:type="smallint" name="multiline_count" padding="5" unsigned="true" nullable="false" identity="false"
  439. default="1" comment="Multiline Count"/>
  440. <column xsi:type="text" name="validate_rules" nullable="true" comment="Validate Rules"/>
  441. <column xsi:type="smallint" name="is_system" padding="5" unsigned="true" nullable="false" identity="false"
  442. default="0" comment="Is System"/>
  443. <column xsi:type="int" name="sort_order" padding="10" unsigned="true" nullable="false" identity="false"
  444. default="0" comment="Sort Order"/>
  445. <column xsi:type="varchar" name="data_model" nullable="true" length="255" comment="Data Model"/>
  446. <column xsi:type="smallint" name="is_used_in_grid" padding="5" unsigned="true" nullable="false" identity="false"
  447. default="0" comment="Is Used in Grid"/>
  448. <column xsi:type="smallint" name="is_visible_in_grid" padding="5" unsigned="true" nullable="false"
  449. identity="false" default="0" comment="Is Visible in Grid"/>
  450. <column xsi:type="smallint" name="is_filterable_in_grid" padding="5" unsigned="true" nullable="false"
  451. identity="false" default="0" comment="Is Filterable in Grid"/>
  452. <column xsi:type="smallint" name="is_searchable_in_grid" padding="5" unsigned="true" nullable="false"
  453. identity="false" default="0" comment="Is Searchable in Grid"/>
  454. <constraint xsi:type="primary" referenceId="PRIMARY">
  455. <column name="attribute_id"/>
  456. </constraint>
  457. <constraint xsi:type="foreign" referenceId="CUSTOMER_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  458. table="customer_eav_attribute" column="attribute_id" referenceTable="eav_attribute"
  459. referenceColumn="attribute_id" onDelete="CASCADE"/>
  460. </table>
  461. <table name="customer_form_attribute" resource="default" engine="innodb" comment="Customer Form Attribute">
  462. <column xsi:type="varchar" name="form_code" nullable="false" length="32" comment="Form Code"/>
  463. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  464. comment="Attribute Id"/>
  465. <constraint xsi:type="primary" referenceId="PRIMARY">
  466. <column name="form_code"/>
  467. <column name="attribute_id"/>
  468. </constraint>
  469. <constraint xsi:type="foreign" referenceId="CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID"
  470. table="customer_form_attribute" column="attribute_id" referenceTable="eav_attribute"
  471. referenceColumn="attribute_id" onDelete="CASCADE"/>
  472. <index referenceId="CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE_ID" indexType="btree">
  473. <column name="attribute_id"/>
  474. </index>
  475. </table>
  476. <table name="customer_eav_attribute_website" resource="default" engine="innodb"
  477. comment="Customer Eav Attribute Website">
  478. <column xsi:type="smallint" name="attribute_id" padding="5" unsigned="true" nullable="false" identity="false"
  479. comment="Attribute Id"/>
  480. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  481. comment="Website Id"/>
  482. <column xsi:type="smallint" name="is_visible" padding="5" unsigned="true" nullable="true" identity="false"
  483. comment="Is Visible"/>
  484. <column xsi:type="smallint" name="is_required" padding="5" unsigned="true" nullable="true" identity="false"
  485. comment="Is Required"/>
  486. <column xsi:type="text" name="default_value" nullable="true" comment="Default Value"/>
  487. <column xsi:type="smallint" name="multiline_count" padding="5" unsigned="true" nullable="true" identity="false"
  488. comment="Multiline Count"/>
  489. <constraint xsi:type="primary" referenceId="PRIMARY">
  490. <column name="attribute_id"/>
  491. <column name="website_id"/>
  492. </constraint>
  493. <constraint xsi:type="foreign" referenceId="CSTR_EAV_ATTR_WS_ATTR_ID_EAV_ATTR_ATTR_ID"
  494. table="customer_eav_attribute_website" column="attribute_id" referenceTable="eav_attribute"
  495. referenceColumn="attribute_id" onDelete="CASCADE"/>
  496. <constraint xsi:type="foreign" referenceId="CSTR_EAV_ATTR_WS_WS_ID_STORE_WS_WS_ID"
  497. table="customer_eav_attribute_website" column="website_id" referenceTable="store_website"
  498. referenceColumn="website_id" onDelete="CASCADE"/>
  499. <index referenceId="CUSTOMER_EAV_ATTRIBUTE_WEBSITE_WEBSITE_ID" indexType="btree">
  500. <column name="website_id"/>
  501. </index>
  502. </table>
  503. <table name="customer_visitor" resource="default" engine="innodb" comment="Visitor Table">
  504. <column xsi:type="bigint" name="visitor_id" padding="20" unsigned="true" nullable="false" identity="true"
  505. comment="Visitor ID"/>
  506. <column xsi:type="int" name="customer_id" padding="11" unsigned="false" nullable="true" identity="false"
  507. comment="Customer Id"/>
  508. <column xsi:type="varchar" name="session_id" nullable="true" length="64" comment="Session ID"/>
  509. <column xsi:type="timestamp" name="last_visit_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  510. comment="Last Visit Time"/>
  511. <constraint xsi:type="primary" referenceId="PRIMARY">
  512. <column name="visitor_id"/>
  513. </constraint>
  514. <index referenceId="CUSTOMER_VISITOR_CUSTOMER_ID" indexType="btree">
  515. <column name="customer_id"/>
  516. </index>
  517. <index referenceId="CUSTOMER_VISITOR_LAST_VISIT_AT" indexType="btree">
  518. <column name="last_visit_at"/>
  519. </index>
  520. </table>
  521. <table name="customer_log" resource="default" engine="innodb" comment="Customer Log Table">
  522. <column xsi:type="int" name="log_id" padding="11" unsigned="false" nullable="false" identity="true"
  523. comment="Log ID"/>
  524. <column xsi:type="int" name="customer_id" padding="11" unsigned="false" nullable="false" identity="false"
  525. comment="Customer ID"/>
  526. <column xsi:type="timestamp" name="last_login_at" on_update="false" nullable="true" comment="Last Login Time"/>
  527. <column xsi:type="timestamp" name="last_logout_at" on_update="false" nullable="true"
  528. comment="Last Logout Time"/>
  529. <constraint xsi:type="primary" referenceId="PRIMARY">
  530. <column name="log_id"/>
  531. </constraint>
  532. <constraint xsi:type="unique" referenceId="CUSTOMER_LOG_CUSTOMER_ID">
  533. <column name="customer_id"/>
  534. </constraint>
  535. </table>
  536. </schema>