db_schema.xml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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="quote" resource="checkout" engine="innodb" comment="Sales Flat Quote">
  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="store_id" padding="5" unsigned="true" nullable="false" identity="false"
  14. default="0" comment="Store Id"/>
  15. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  16. comment="Created At"/>
  17. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"/>
  18. <column xsi:type="timestamp" name="converted_at" on_update="false" nullable="true" comment="Converted At"/>
  19. <column xsi:type="smallint" name="is_active" padding="5" unsigned="true" nullable="true" identity="false"
  20. default="1" comment="Is Active"/>
  21. <column xsi:type="smallint" name="is_virtual" padding="5" unsigned="true" nullable="true" identity="false"
  22. default="0" comment="Is Virtual"/>
  23. <column xsi:type="smallint" name="is_multi_shipping" padding="5" unsigned="true" nullable="true"
  24. identity="false" default="0" comment="Is Multi Shipping"/>
  25. <column xsi:type="int" name="items_count" padding="10" unsigned="true" nullable="true" identity="false"
  26. default="0" comment="Items Count"/>
  27. <column xsi:type="decimal" name="items_qty" scale="4" precision="12" unsigned="false" nullable="true"
  28. default="0" comment="Items Qty"/>
  29. <column xsi:type="int" name="orig_order_id" padding="10" unsigned="true" nullable="true" identity="false"
  30. default="0" comment="Orig Order Id"/>
  31. <column xsi:type="decimal" name="store_to_base_rate" scale="4" precision="12" unsigned="false" nullable="true"
  32. default="0" comment="Store To Base Rate"/>
  33. <column xsi:type="decimal" name="store_to_quote_rate" scale="4" precision="12" unsigned="false" nullable="true"
  34. default="0" comment="Store To Quote Rate"/>
  35. <column xsi:type="varchar" name="base_currency_code" nullable="true" length="255" comment="Base Currency Code"/>
  36. <column xsi:type="varchar" name="store_currency_code" nullable="true" length="255"
  37. comment="Store Currency Code"/>
  38. <column xsi:type="varchar" name="quote_currency_code" nullable="true" length="255"
  39. comment="Quote Currency Code"/>
  40. <column xsi:type="decimal" name="grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  41. default="0" comment="Grand Total"/>
  42. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  43. default="0" comment="Base Grand Total"/>
  44. <column xsi:type="varchar" name="checkout_method" nullable="true" length="255" comment="Checkout Method"/>
  45. <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false"
  46. comment="Customer Id"/>
  47. <column xsi:type="int" name="customer_tax_class_id" padding="10" unsigned="true" nullable="true"
  48. identity="false" comment="Customer Tax Class Id"/>
  49. <column xsi:type="int" name="customer_group_id" padding="10" unsigned="true" nullable="true" identity="false"
  50. default="0" comment="Customer Group Id"/>
  51. <column xsi:type="varchar" name="customer_email" nullable="true" length="255" comment="Customer Email"/>
  52. <column xsi:type="varchar" name="customer_prefix" nullable="true" length="40" comment="Customer Prefix"/>
  53. <column xsi:type="varchar" name="customer_firstname" nullable="true" length="255" comment="Customer Firstname"/>
  54. <column xsi:type="varchar" name="customer_middlename" nullable="true" length="40"
  55. comment="Customer Middlename"/>
  56. <column xsi:type="varchar" name="customer_lastname" nullable="true" length="255" comment="Customer Lastname"/>
  57. <column xsi:type="varchar" name="customer_suffix" nullable="true" length="40" comment="Customer Suffix"/>
  58. <column xsi:type="datetime" name="customer_dob" on_update="false" nullable="true" comment="Customer Dob"/>
  59. <column xsi:type="varchar" name="customer_note" nullable="true" length="255" comment="Customer Note"/>
  60. <column xsi:type="smallint" name="customer_note_notify" padding="5" unsigned="true" nullable="true"
  61. identity="false" default="1" comment="Customer Note Notify"/>
  62. <column xsi:type="smallint" name="customer_is_guest" padding="5" unsigned="true" nullable="true"
  63. identity="false" default="0" comment="Customer Is Guest"/>
  64. <column xsi:type="varchar" name="remote_ip" nullable="true" length="45" comment="Remote Ip"/>
  65. <column xsi:type="varchar" name="applied_rule_ids" nullable="true" length="255" comment="Applied Rule Ids"/>
  66. <column xsi:type="varchar" name="reserved_order_id" nullable="true" length="64" comment="Reserved Order Id"/>
  67. <column xsi:type="varchar" name="password_hash" nullable="true" length="255" comment="Password Hash"/>
  68. <column xsi:type="varchar" name="coupon_code" nullable="true" length="255" comment="Coupon Code"/>
  69. <column xsi:type="varchar" name="global_currency_code" nullable="true" length="255"
  70. comment="Global Currency Code"/>
  71. <column xsi:type="decimal" name="base_to_global_rate" scale="4" precision="20" unsigned="false" nullable="true"
  72. comment="Base To Global Rate"/>
  73. <column xsi:type="decimal" name="base_to_quote_rate" scale="4" precision="20" unsigned="false" nullable="true"
  74. comment="Base To Quote Rate"/>
  75. <column xsi:type="varchar" name="customer_taxvat" nullable="true" length="255" comment="Customer Taxvat"/>
  76. <column xsi:type="varchar" name="customer_gender" nullable="true" length="255" comment="Customer Gender"/>
  77. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  78. comment="Subtotal"/>
  79. <column xsi:type="decimal" name="base_subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  80. comment="Base Subtotal"/>
  81. <column xsi:type="decimal" name="subtotal_with_discount" scale="4" precision="20" unsigned="false"
  82. nullable="true" comment="Subtotal With Discount"/>
  83. <column xsi:type="decimal" name="base_subtotal_with_discount" scale="4" precision="20" unsigned="false"
  84. nullable="true" comment="Base Subtotal With Discount"/>
  85. <column xsi:type="int" name="is_changed" padding="10" unsigned="true" nullable="true" identity="false"
  86. comment="Is Changed"/>
  87. <column xsi:type="smallint" name="trigger_recollect" padding="6" unsigned="false" nullable="false"
  88. identity="false" default="0" comment="Trigger Recollect"/>
  89. <column xsi:type="text" name="ext_shipping_info" nullable="true" comment="Ext Shipping Info"/>
  90. <constraint xsi:type="primary" referenceId="PRIMARY">
  91. <column name="entity_id"/>
  92. </constraint>
  93. <constraint xsi:type="foreign" referenceId="QUOTE_STORE_ID_STORE_STORE_ID" table="quote" column="store_id"
  94. referenceTable="store" referenceColumn="store_id" onDelete="CASCADE"/>
  95. <index referenceId="QUOTE_CUSTOMER_ID_STORE_ID_IS_ACTIVE" indexType="btree">
  96. <column name="customer_id"/>
  97. <column name="store_id"/>
  98. <column name="is_active"/>
  99. </index>
  100. <index referenceId="QUOTE_STORE_ID" indexType="btree">
  101. <column name="store_id"/>
  102. </index>
  103. </table>
  104. <table name="quote_address" resource="checkout" engine="innodb" comment="Sales Flat Quote Address">
  105. <column xsi:type="int" name="address_id" padding="10" unsigned="true" nullable="false" identity="true"
  106. comment="Address Id"/>
  107. <column xsi:type="int" name="quote_id" padding="10" unsigned="true" nullable="false" identity="false"
  108. default="0" comment="Quote Id"/>
  109. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  110. comment="Created At"/>
  111. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="0"
  112. comment="Updated At"/>
  113. <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="true" identity="false"
  114. comment="Customer Id"/>
  115. <column xsi:type="smallint" name="save_in_address_book" padding="6" unsigned="false" nullable="true"
  116. identity="false" default="0" comment="Save In Address Book"/>
  117. <column xsi:type="int" name="customer_address_id" padding="10" unsigned="true" nullable="true" identity="false"
  118. comment="Customer Address Id"/>
  119. <column xsi:type="varchar" name="address_type" nullable="true" length="10" comment="Address Type"/>
  120. <column xsi:type="varchar" name="email" nullable="true" length="255" comment="Email"/>
  121. <column xsi:type="varchar" name="prefix" nullable="true" length="40" comment="Prefix"/>
  122. <column xsi:type="varchar" name="firstname" nullable="true" length="255"/>
  123. <column xsi:type="varchar" name="middlename" nullable="true" length="40"/>
  124. <column xsi:type="varchar" name="lastname" nullable="true" length="255"/>
  125. <column xsi:type="varchar" name="suffix" nullable="true" length="40" comment="Suffix"/>
  126. <column xsi:type="varchar" name="company" nullable="true" length="255" comment="Company"/>
  127. <column xsi:type="varchar" name="street" nullable="true" length="255" onCreate="migrateDataFrom(street)"
  128. comment="Street"/>
  129. <column xsi:type="varchar" name="city" nullable="true" length="255"/>
  130. <column xsi:type="varchar" name="region" nullable="true" length="255"/>
  131. <column xsi:type="int" name="region_id" padding="10" unsigned="true" nullable="true" identity="false"
  132. comment="Region Id"/>
  133. <column xsi:type="varchar" name="postcode" nullable="true" length="20" comment="Postcode"/>
  134. <column xsi:type="varchar" name="country_id" nullable="true" length="30" comment="Country Id"/>
  135. <column xsi:type="varchar" name="telephone" nullable="true" length="255"/>
  136. <column xsi:type="varchar" name="fax" nullable="true" length="255"/>
  137. <column xsi:type="smallint" name="same_as_billing" padding="5" unsigned="true" nullable="false" identity="false"
  138. default="0" comment="Same As Billing"/>
  139. <column xsi:type="smallint" name="collect_shipping_rates" padding="5" unsigned="true" nullable="false"
  140. identity="false" default="0" comment="Collect Shipping Rates"/>
  141. <column xsi:type="varchar" name="shipping_method" nullable="true" length="120"/>
  142. <column xsi:type="varchar" name="shipping_description" nullable="true" length="255"
  143. comment="Shipping Description"/>
  144. <column xsi:type="decimal" name="weight" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  145. comment="Weight"/>
  146. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="false"
  147. default="0" comment="Subtotal"/>
  148. <column xsi:type="decimal" name="base_subtotal" scale="4" precision="20" unsigned="false" nullable="false"
  149. default="0" comment="Base Subtotal"/>
  150. <column xsi:type="decimal" name="subtotal_with_discount" scale="4" precision="20" unsigned="false"
  151. nullable="false" default="0" comment="Subtotal With Discount"/>
  152. <column xsi:type="decimal" name="base_subtotal_with_discount" scale="4" precision="20" unsigned="false"
  153. nullable="false" default="0" comment="Base Subtotal With Discount"/>
  154. <column xsi:type="decimal" name="tax_amount" scale="4" precision="20" unsigned="false" nullable="false"
  155. default="0" comment="Tax Amount"/>
  156. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="20" unsigned="false" nullable="false"
  157. default="0" comment="Base Tax Amount"/>
  158. <column xsi:type="decimal" name="shipping_amount" scale="4" precision="20" unsigned="false" nullable="false"
  159. default="0" comment="Shipping Amount"/>
  160. <column xsi:type="decimal" name="base_shipping_amount" scale="4" precision="20" unsigned="false"
  161. nullable="false" default="0" comment="Base Shipping Amount"/>
  162. <column xsi:type="decimal" name="shipping_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  163. comment="Shipping Tax Amount"/>
  164. <column xsi:type="decimal" name="base_shipping_tax_amount" scale="4" precision="20" unsigned="false"
  165. nullable="true" comment="Base Shipping Tax Amount"/>
  166. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="false"
  167. default="0" comment="Discount Amount"/>
  168. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="20" unsigned="false"
  169. nullable="false" default="0" comment="Base Discount Amount"/>
  170. <column xsi:type="decimal" name="grand_total" scale="4" precision="20" unsigned="false" nullable="false"
  171. default="0" comment="Grand Total"/>
  172. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="false"
  173. default="0" comment="Base Grand Total"/>
  174. <column xsi:type="text" name="customer_notes" nullable="true" comment="Customer Notes"/>
  175. <column xsi:type="text" name="applied_taxes" nullable="true" comment="Applied Taxes"/>
  176. <column xsi:type="varchar" name="discount_description" nullable="true" length="255"
  177. comment="Discount Description"/>
  178. <column xsi:type="decimal" name="shipping_discount_amount" scale="4" precision="20" unsigned="false"
  179. nullable="true" comment="Shipping Discount Amount"/>
  180. <column xsi:type="decimal" name="base_shipping_discount_amount" scale="4" precision="20" unsigned="false"
  181. nullable="true" comment="Base Shipping Discount Amount"/>
  182. <column xsi:type="decimal" name="subtotal_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  183. comment="Subtotal Incl Tax"/>
  184. <column xsi:type="decimal" name="base_subtotal_total_incl_tax" scale="4" precision="20" unsigned="false"
  185. nullable="true" comment="Base Subtotal Total Incl Tax"/>
  186. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="20" unsigned="false"
  187. nullable="true" comment="Discount Tax Compensation Amount"/>
  188. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="20"
  189. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  190. <column xsi:type="decimal" name="shipping_discount_tax_compensation_amount" scale="4" precision="20"
  191. unsigned="false" nullable="true" comment="Shipping Discount Tax Compensation Amount"/>
  192. <column xsi:type="decimal" name="base_shipping_discount_tax_compensation_amnt" scale="4" precision="20"
  193. unsigned="false" nullable="true" comment="Base Shipping Discount Tax Compensation Amount"/>
  194. <column xsi:type="decimal" name="shipping_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  195. comment="Shipping Incl Tax"/>
  196. <column xsi:type="decimal" name="base_shipping_incl_tax" scale="4" precision="20" unsigned="false"
  197. nullable="true" comment="Base Shipping Incl Tax"/>
  198. <column xsi:type="text" name="vat_id" nullable="true" comment="Vat Id"/>
  199. <column xsi:type="smallint" name="vat_is_valid" padding="6" unsigned="false" nullable="true" identity="false"
  200. comment="Vat Is Valid"/>
  201. <column xsi:type="text" name="vat_request_id" nullable="true" comment="Vat Request Id"/>
  202. <column xsi:type="text" name="vat_request_date" nullable="true" comment="Vat Request Date"/>
  203. <column xsi:type="smallint" name="vat_request_success" padding="6" unsigned="false" nullable="true"
  204. identity="false" comment="Vat Request Success"/>
  205. <constraint xsi:type="primary" referenceId="PRIMARY">
  206. <column name="address_id"/>
  207. </constraint>
  208. <constraint xsi:type="foreign" referenceId="QUOTE_ADDRESS_QUOTE_ID_QUOTE_ENTITY_ID" table="quote_address"
  209. column="quote_id" referenceTable="quote" referenceColumn="entity_id" onDelete="CASCADE"/>
  210. <index referenceId="QUOTE_ADDRESS_QUOTE_ID" indexType="btree">
  211. <column name="quote_id"/>
  212. </index>
  213. </table>
  214. <table name="quote_item" resource="checkout" engine="innodb" comment="Sales Flat Quote Item">
  215. <column xsi:type="int" name="item_id" padding="10" unsigned="true" nullable="false" identity="true"
  216. comment="Item Id"/>
  217. <column xsi:type="int" name="quote_id" padding="10" unsigned="true" nullable="false" identity="false"
  218. default="0" comment="Quote Id"/>
  219. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  220. comment="Created At"/>
  221. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="0"
  222. comment="Updated At"/>
  223. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="true" identity="false"
  224. comment="Product Id"/>
  225. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
  226. comment="Store Id"/>
  227. <column xsi:type="int" name="parent_item_id" padding="10" unsigned="true" nullable="true" identity="false"
  228. comment="Parent Item Id"/>
  229. <column xsi:type="smallint" name="is_virtual" padding="5" unsigned="true" nullable="true" identity="false"
  230. comment="Is Virtual"/>
  231. <column xsi:type="varchar" name="sku" nullable="true" length="255" comment="Sku"/>
  232. <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
  233. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  234. <column xsi:type="text" name="applied_rule_ids" nullable="true" comment="Applied Rule Ids"/>
  235. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  236. <column xsi:type="smallint" name="is_qty_decimal" padding="5" unsigned="true" nullable="true" identity="false"
  237. comment="Is Qty Decimal"/>
  238. <column xsi:type="smallint" name="no_discount" padding="5" unsigned="true" nullable="true" identity="false"
  239. default="0" comment="No Discount"/>
  240. <column xsi:type="decimal" name="weight" scale="4" precision="12" unsigned="false" nullable="true" default="0"
  241. comment="Weight"/>
  242. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  243. comment="Qty"/>
  244. <column xsi:type="decimal" name="price" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  245. comment="Price"/>
  246. <column xsi:type="decimal" name="base_price" scale="4" precision="12" unsigned="false" nullable="false"
  247. default="0" comment="Base Price"/>
  248. <column xsi:type="decimal" name="custom_price" scale="4" precision="12" unsigned="false" nullable="true"
  249. comment="Custom Price"/>
  250. <column xsi:type="decimal" name="discount_percent" scale="4" precision="12" unsigned="false" nullable="true"
  251. default="0" comment="Discount Percent"/>
  252. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="true"
  253. default="0" comment="Discount Amount"/>
  254. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="20" unsigned="false"
  255. nullable="true" default="0" comment="Base Discount Amount"/>
  256. <column xsi:type="decimal" name="tax_percent" scale="4" precision="12" unsigned="false" nullable="true"
  257. default="0" comment="Tax Percent"/>
  258. <column xsi:type="decimal" name="tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  259. default="0" comment="Tax Amount"/>
  260. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  261. default="0" comment="Base Tax Amount"/>
  262. <column xsi:type="decimal" name="row_total" scale="4" precision="20" unsigned="false" nullable="false"
  263. default="0" comment="Row Total"/>
  264. <column xsi:type="decimal" name="base_row_total" scale="4" precision="20" unsigned="false" nullable="false"
  265. default="0" comment="Base Row Total"/>
  266. <column xsi:type="decimal" name="row_total_with_discount" scale="4" precision="20" unsigned="false"
  267. nullable="true" default="0" comment="Row Total With Discount"/>
  268. <column xsi:type="decimal" name="row_weight" scale="4" precision="12" unsigned="false" nullable="true"
  269. default="0" comment="Row Weight"/>
  270. <column xsi:type="varchar" name="product_type" nullable="true" length="255" comment="Product Type"/>
  271. <column xsi:type="decimal" name="base_tax_before_discount" scale="4" precision="20" unsigned="false"
  272. nullable="true" comment="Base Tax Before Discount"/>
  273. <column xsi:type="decimal" name="tax_before_discount" scale="4" precision="20" unsigned="false" nullable="true"
  274. comment="Tax Before Discount"/>
  275. <column xsi:type="decimal" name="original_custom_price" scale="4" precision="12" unsigned="false"
  276. nullable="true" comment="Original Custom Price"/>
  277. <column xsi:type="varchar" name="redirect_url" nullable="true" length="255" comment="Redirect Url"/>
  278. <column xsi:type="decimal" name="base_cost" scale="4" precision="12" unsigned="false" nullable="true"
  279. comment="Base Cost"/>
  280. <column xsi:type="decimal" name="price_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  281. comment="Price Incl Tax"/>
  282. <column xsi:type="decimal" name="base_price_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  283. comment="Base Price Incl Tax"/>
  284. <column xsi:type="decimal" name="row_total_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  285. comment="Row Total Incl Tax"/>
  286. <column xsi:type="decimal" name="base_row_total_incl_tax" scale="4" precision="20" unsigned="false"
  287. nullable="true" comment="Base Row Total Incl Tax"/>
  288. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="20" unsigned="false"
  289. nullable="true" comment="Discount Tax Compensation Amount"/>
  290. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="20"
  291. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  292. <constraint xsi:type="primary" referenceId="PRIMARY">
  293. <column name="item_id"/>
  294. </constraint>
  295. <constraint xsi:type="foreign" referenceId="QUOTE_ITEM_PARENT_ITEM_ID_QUOTE_ITEM_ITEM_ID" table="quote_item"
  296. column="parent_item_id" referenceTable="quote_item" referenceColumn="item_id" onDelete="CASCADE"/>
  297. <constraint xsi:type="foreign" referenceId="QUOTE_ITEM_QUOTE_ID_QUOTE_ENTITY_ID" table="quote_item" column="quote_id"
  298. referenceTable="quote" referenceColumn="entity_id" onDelete="CASCADE"/>
  299. <constraint xsi:type="foreign" referenceId="QUOTE_ITEM_STORE_ID_STORE_STORE_ID" table="quote_item" column="store_id"
  300. referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  301. <index referenceId="QUOTE_ITEM_PARENT_ITEM_ID" indexType="btree">
  302. <column name="parent_item_id"/>
  303. </index>
  304. <index referenceId="QUOTE_ITEM_PRODUCT_ID" indexType="btree">
  305. <column name="product_id"/>
  306. </index>
  307. <index referenceId="QUOTE_ITEM_QUOTE_ID" indexType="btree">
  308. <column name="quote_id"/>
  309. </index>
  310. <index referenceId="QUOTE_ITEM_STORE_ID" indexType="btree">
  311. <column name="store_id"/>
  312. </index>
  313. </table>
  314. <table name="quote_address_item" resource="checkout" engine="innodb" comment="Sales Flat Quote Address Item">
  315. <column xsi:type="int" name="address_item_id" padding="10" unsigned="true" nullable="false" identity="true"
  316. comment="Address Item Id"/>
  317. <column xsi:type="int" name="parent_item_id" padding="10" unsigned="true" nullable="true" identity="false"
  318. comment="Parent Item Id"/>
  319. <column xsi:type="int" name="quote_address_id" padding="10" unsigned="true" nullable="false" identity="false"
  320. default="0" comment="Quote Address Id"/>
  321. <column xsi:type="int" name="quote_item_id" padding="10" unsigned="true" nullable="false" identity="false"
  322. default="0" comment="Quote Item Id"/>
  323. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  324. comment="Created At"/>
  325. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="0"
  326. comment="Updated At"/>
  327. <column xsi:type="text" name="applied_rule_ids" nullable="true" comment="Applied Rule Ids"/>
  328. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  329. <column xsi:type="decimal" name="weight" scale="4" precision="12" unsigned="false" nullable="true" default="0"
  330. comment="Weight"/>
  331. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  332. comment="Qty"/>
  333. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="true"
  334. default="0" comment="Discount Amount"/>
  335. <column xsi:type="decimal" name="tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  336. default="0" comment="Tax Amount"/>
  337. <column xsi:type="decimal" name="row_total" scale="4" precision="20" unsigned="false" nullable="false"
  338. default="0" comment="Row Total"/>
  339. <column xsi:type="decimal" name="base_row_total" scale="4" precision="20" unsigned="false" nullable="false"
  340. default="0" comment="Base Row Total"/>
  341. <column xsi:type="decimal" name="row_total_with_discount" scale="4" precision="20" unsigned="false"
  342. nullable="true" default="0" comment="Row Total With Discount"/>
  343. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="20" unsigned="false"
  344. nullable="true" default="0" comment="Base Discount Amount"/>
  345. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  346. default="0" comment="Base Tax Amount"/>
  347. <column xsi:type="decimal" name="row_weight" scale="4" precision="12" unsigned="false" nullable="true"
  348. default="0" comment="Row Weight"/>
  349. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="true" identity="false"
  350. comment="Product Id"/>
  351. <column xsi:type="int" name="super_product_id" padding="10" unsigned="true" nullable="true" identity="false"
  352. comment="Super Product Id"/>
  353. <column xsi:type="int" name="parent_product_id" padding="10" unsigned="true" nullable="true" identity="false"
  354. comment="Parent Product Id"/>
  355. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
  356. comment="Store Id"/>
  357. <column xsi:type="varchar" name="sku" nullable="true" length="255" comment="Sku"/>
  358. <column xsi:type="varchar" name="image" nullable="true" length="255" comment="Image"/>
  359. <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
  360. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  361. <column xsi:type="int" name="is_qty_decimal" padding="10" unsigned="true" nullable="true" identity="false"
  362. comment="Is Qty Decimal"/>
  363. <column xsi:type="decimal" name="price" scale="4" precision="12" unsigned="false" nullable="true"
  364. comment="Price"/>
  365. <column xsi:type="decimal" name="discount_percent" scale="4" precision="12" unsigned="false" nullable="true"
  366. comment="Discount Percent"/>
  367. <column xsi:type="int" name="no_discount" padding="10" unsigned="true" nullable="true" identity="false"
  368. comment="No Discount"/>
  369. <column xsi:type="decimal" name="tax_percent" scale="4" precision="12" unsigned="false" nullable="true"
  370. comment="Tax Percent"/>
  371. <column xsi:type="decimal" name="base_price" scale="4" precision="12" unsigned="false" nullable="true"
  372. comment="Base Price"/>
  373. <column xsi:type="decimal" name="base_cost" scale="4" precision="12" unsigned="false" nullable="true"
  374. comment="Base Cost"/>
  375. <column xsi:type="decimal" name="price_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  376. comment="Price Incl Tax"/>
  377. <column xsi:type="decimal" name="base_price_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  378. comment="Base Price Incl Tax"/>
  379. <column xsi:type="decimal" name="row_total_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  380. comment="Row Total Incl Tax"/>
  381. <column xsi:type="decimal" name="base_row_total_incl_tax" scale="4" precision="20" unsigned="false"
  382. nullable="true" comment="Base Row Total Incl Tax"/>
  383. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="20" unsigned="false"
  384. nullable="true" comment="Discount Tax Compensation Amount"/>
  385. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="20"
  386. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  387. <constraint xsi:type="primary" referenceId="PRIMARY">
  388. <column name="address_item_id"/>
  389. </constraint>
  390. <constraint xsi:type="foreign" referenceId="QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS_ID_QUOTE_ADDRESS_ADDRESS_ID"
  391. table="quote_address_item" column="quote_address_id" referenceTable="quote_address"
  392. referenceColumn="address_id" onDelete="CASCADE"/>
  393. <constraint xsi:type="foreign" referenceId="QUOTE_ADDR_ITEM_PARENT_ITEM_ID_QUOTE_ADDR_ITEM_ADDR_ITEM_ID"
  394. table="quote_address_item" column="parent_item_id" referenceTable="quote_address_item"
  395. referenceColumn="address_item_id" onDelete="CASCADE"/>
  396. <constraint xsi:type="foreign" referenceId="QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID_QUOTE_ITEM_ITEM_ID"
  397. table="quote_address_item" column="quote_item_id" referenceTable="quote_item"
  398. referenceColumn="item_id" onDelete="CASCADE"/>
  399. <index referenceId="QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS_ID" indexType="btree">
  400. <column name="quote_address_id"/>
  401. </index>
  402. <index referenceId="QUOTE_ADDRESS_ITEM_PARENT_ITEM_ID" indexType="btree">
  403. <column name="parent_item_id"/>
  404. </index>
  405. <index referenceId="QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID" indexType="btree">
  406. <column name="quote_item_id"/>
  407. </index>
  408. <index referenceId="QUOTE_ADDRESS_ITEM_STORE_ID" indexType="btree">
  409. <column name="store_id"/>
  410. </index>
  411. </table>
  412. <table name="quote_item_option" resource="checkout" engine="innodb" comment="Sales Flat Quote Item Option">
  413. <column xsi:type="int" name="option_id" padding="10" unsigned="true" nullable="false" identity="true"
  414. comment="Option Id"/>
  415. <column xsi:type="int" name="item_id" padding="10" unsigned="true" nullable="false" identity="false"
  416. comment="Item Id"/>
  417. <column xsi:type="int" name="product_id" padding="10" unsigned="true" nullable="false" identity="false"
  418. comment="Product Id"/>
  419. <column xsi:type="varchar" name="code" nullable="false" length="255" comment="Code"/>
  420. <column xsi:type="text" name="value" nullable="true" comment="Value"/>
  421. <constraint xsi:type="primary" referenceId="PRIMARY">
  422. <column name="option_id"/>
  423. </constraint>
  424. <constraint xsi:type="foreign" referenceId="QUOTE_ITEM_OPTION_ITEM_ID_QUOTE_ITEM_ITEM_ID" table="quote_item_option"
  425. column="item_id" referenceTable="quote_item" referenceColumn="item_id" onDelete="CASCADE"/>
  426. <index referenceId="QUOTE_ITEM_OPTION_ITEM_ID" indexType="btree">
  427. <column name="item_id"/>
  428. </index>
  429. </table>
  430. <table name="quote_payment" resource="checkout" engine="innodb" comment="Sales Flat Quote Payment">
  431. <column xsi:type="int" name="payment_id" padding="10" unsigned="true" nullable="false" identity="true"
  432. comment="Payment Id"/>
  433. <column xsi:type="int" name="quote_id" padding="10" unsigned="true" nullable="false" identity="false"
  434. default="0" comment="Quote Id"/>
  435. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  436. comment="Created At"/>
  437. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="0"
  438. comment="Updated At"/>
  439. <column xsi:type="varchar" name="method" nullable="true" length="255" comment="Method"/>
  440. <column xsi:type="varchar" name="cc_type" nullable="true" length="255" comment="Cc Type"/>
  441. <column xsi:type="varchar" name="cc_number_enc" nullable="true" length="255" comment="Cc Number Enc"/>
  442. <column xsi:type="varchar" name="cc_last_4" nullable="true" length="255" comment="Cc Last 4"/>
  443. <column xsi:type="varchar" name="cc_cid_enc" nullable="true" length="255" comment="Cc Cid Enc"/>
  444. <column xsi:type="varchar" name="cc_owner" nullable="true" length="255" comment="Cc Owner"/>
  445. <column xsi:type="varchar" name="cc_exp_month" nullable="true" length="255" comment="Cc Exp Month"/>
  446. <column xsi:type="smallint" name="cc_exp_year" padding="5" unsigned="true" nullable="true" identity="false"
  447. default="0" comment="Cc Exp Year"/>
  448. <column xsi:type="varchar" name="cc_ss_owner" nullable="true" length="255" comment="Cc Ss Owner"/>
  449. <column xsi:type="smallint" name="cc_ss_start_month" padding="5" unsigned="true" nullable="true"
  450. identity="false" default="0" comment="Cc Ss Start Month"/>
  451. <column xsi:type="smallint" name="cc_ss_start_year" padding="5" unsigned="true" nullable="true" identity="false"
  452. default="0" comment="Cc Ss Start Year"/>
  453. <column xsi:type="varchar" name="po_number" nullable="true" length="255" comment="Po Number"/>
  454. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  455. <column xsi:type="varchar" name="cc_ss_issue" nullable="true" length="255" comment="Cc Ss Issue"/>
  456. <column xsi:type="text" name="additional_information" nullable="true" comment="Additional Information"/>
  457. <constraint xsi:type="primary" referenceId="PRIMARY">
  458. <column name="payment_id"/>
  459. </constraint>
  460. <constraint xsi:type="foreign" referenceId="QUOTE_PAYMENT_QUOTE_ID_QUOTE_ENTITY_ID" table="quote_payment"
  461. column="quote_id" referenceTable="quote" referenceColumn="entity_id" onDelete="CASCADE"/>
  462. <index referenceId="QUOTE_PAYMENT_QUOTE_ID" indexType="btree">
  463. <column name="quote_id"/>
  464. </index>
  465. </table>
  466. <table name="quote_shipping_rate" resource="checkout" engine="innodb" comment="Sales Flat Quote Shipping Rate">
  467. <column xsi:type="int" name="rate_id" padding="10" unsigned="true" nullable="false" identity="true"
  468. comment="Rate Id"/>
  469. <column xsi:type="int" name="address_id" padding="10" unsigned="true" nullable="false" identity="false"
  470. default="0" comment="Address Id"/>
  471. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  472. comment="Created At"/>
  473. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="0"
  474. comment="Updated At"/>
  475. <column xsi:type="varchar" name="carrier" nullable="true" length="255" comment="Carrier"/>
  476. <column xsi:type="varchar" name="carrier_title" nullable="true" length="255" comment="Carrier Title"/>
  477. <column xsi:type="varchar" name="code" nullable="true" length="255" comment="Code"/>
  478. <column xsi:type="varchar" name="method" nullable="true" length="255" comment="Method"/>
  479. <column xsi:type="text" name="method_description" nullable="true" comment="Method Description"/>
  480. <column xsi:type="decimal" name="price" scale="4" precision="20" unsigned="false" nullable="false" default="0"
  481. comment="Price"/>
  482. <column xsi:type="text" name="error_message" nullable="true" comment="Error Message"/>
  483. <column xsi:type="text" name="method_title" nullable="true" comment="Method Title"/>
  484. <constraint xsi:type="primary" referenceId="PRIMARY">
  485. <column name="rate_id"/>
  486. </constraint>
  487. <constraint xsi:type="foreign" referenceId="QUOTE_SHIPPING_RATE_ADDRESS_ID_QUOTE_ADDRESS_ADDRESS_ID"
  488. table="quote_shipping_rate" column="address_id" referenceTable="quote_address"
  489. referenceColumn="address_id" onDelete="CASCADE"/>
  490. <index referenceId="QUOTE_SHIPPING_RATE_ADDRESS_ID" indexType="btree">
  491. <column name="address_id"/>
  492. </index>
  493. </table>
  494. <table name="quote_id_mask" resource="checkout" engine="innodb" comment="Quote ID and masked ID mapping">
  495. <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true"
  496. comment="Entity ID"/>
  497. <column xsi:type="int" name="quote_id" padding="10" unsigned="true" nullable="false" identity="false"
  498. comment="Quote ID"/>
  499. <column xsi:type="varchar" name="masked_id" nullable="true" length="32" comment="Masked ID"/>
  500. <constraint xsi:type="primary" referenceId="PRIMARY">
  501. <column name="entity_id"/>
  502. <column name="quote_id"/>
  503. </constraint>
  504. <constraint xsi:type="foreign" referenceId="QUOTE_ID_MASK_QUOTE_ID_QUOTE_ENTITY_ID" table="quote_id_mask"
  505. column="quote_id" referenceTable="quote" referenceColumn="entity_id" onDelete="CASCADE"/>
  506. <index referenceId="QUOTE_ID_MASK_QUOTE_ID" indexType="btree">
  507. <column name="quote_id"/>
  508. </index>
  509. <index referenceId="QUOTE_ID_MASK_MASKED_ID" indexType="btree">
  510. <column name="masked_id"/>
  511. </index>
  512. </table>
  513. </schema>