You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

562 lines
37 KiB

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