Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

2067 строки
146 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="sales_order" resource="sales" engine="innodb" comment="Sales Flat Order">
  11. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  12. comment="Entity ID"/>
  13. <column xsi:type="varchar" name="state" nullable="true" length="32" comment="State"/>
  14. <column xsi:type="varchar" name="status" nullable="true" length="32" comment="Status"/>
  15. <column xsi:type="varchar" name="coupon_code" nullable="true" length="255" comment="Coupon Code"/>
  16. <column xsi:type="varchar" name="protect_code" nullable="true" length="255" comment="Protect Code"/>
  17. <column xsi:type="varchar" name="shipping_description" nullable="true" length="255"
  18. comment="Shipping Description"/>
  19. <column xsi:type="smallint" name="is_virtual" unsigned="true" nullable="true" identity="false"
  20. comment="Is Virtual"/>
  21. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  22. comment="Store ID"/>
  23. <column xsi:type="int" name="customer_id" unsigned="true" nullable="true" identity="false"
  24. comment="Customer ID"/>
  25. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="20" unsigned="false"
  26. nullable="true" comment="Base Discount Amount"/>
  27. <column xsi:type="decimal" name="base_discount_canceled" scale="4" precision="20" unsigned="false"
  28. nullable="true" comment="Base Discount Canceled"/>
  29. <column xsi:type="decimal" name="base_discount_invoiced" scale="4" precision="20" unsigned="false"
  30. nullable="true" comment="Base Discount Invoiced"/>
  31. <column xsi:type="decimal" name="base_discount_refunded" scale="4" precision="20" unsigned="false"
  32. nullable="true" comment="Base Discount Refunded"/>
  33. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  34. comment="Base Grand Total"/>
  35. <column xsi:type="decimal" name="base_shipping_amount" scale="4" precision="20" unsigned="false"
  36. nullable="true" comment="Base Shipping Amount"/>
  37. <column xsi:type="decimal" name="base_shipping_canceled" scale="4" precision="20" unsigned="false"
  38. nullable="true" comment="Base Shipping Canceled"/>
  39. <column xsi:type="decimal" name="base_shipping_invoiced" scale="4" precision="20" unsigned="false"
  40. nullable="true" comment="Base Shipping Invoiced"/>
  41. <column xsi:type="decimal" name="base_shipping_refunded" scale="4" precision="20" unsigned="false"
  42. nullable="true" comment="Base Shipping Refunded"/>
  43. <column xsi:type="decimal" name="base_shipping_tax_amount" scale="4" precision="20" unsigned="false"
  44. nullable="true" comment="Base Shipping Tax Amount"/>
  45. <column xsi:type="decimal" name="base_shipping_tax_refunded" scale="4" precision="20" unsigned="false"
  46. nullable="true" comment="Base Shipping Tax Refunded"/>
  47. <column xsi:type="decimal" name="base_subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  48. comment="Base Subtotal"/>
  49. <column xsi:type="decimal" name="base_subtotal_canceled" scale="4" precision="20" unsigned="false"
  50. nullable="true" comment="Base Subtotal Canceled"/>
  51. <column xsi:type="decimal" name="base_subtotal_invoiced" scale="4" precision="20" unsigned="false"
  52. nullable="true" comment="Base Subtotal Invoiced"/>
  53. <column xsi:type="decimal" name="base_subtotal_refunded" scale="4" precision="20" unsigned="false"
  54. nullable="true" comment="Base Subtotal Refunded"/>
  55. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  56. comment="Base Tax Amount"/>
  57. <column xsi:type="decimal" name="base_tax_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  58. comment="Base Tax Canceled"/>
  59. <column xsi:type="decimal" name="base_tax_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  60. comment="Base Tax Invoiced"/>
  61. <column xsi:type="decimal" name="base_tax_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  62. comment="Base Tax Refunded"/>
  63. <column xsi:type="decimal" name="base_to_global_rate" scale="4" precision="20" unsigned="false" nullable="true"
  64. comment="Base To Global Rate"/>
  65. <column xsi:type="decimal" name="base_to_order_rate" scale="4" precision="20" unsigned="false" nullable="true"
  66. comment="Base To Order Rate"/>
  67. <column xsi:type="decimal" name="base_total_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  68. comment="Base Total Canceled"/>
  69. <column xsi:type="decimal" name="base_total_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  70. comment="Base Total Invoiced"/>
  71. <column xsi:type="decimal" name="base_total_invoiced_cost" scale="4" precision="20" unsigned="false"
  72. nullable="true" comment="Base Total Invoiced Cost"/>
  73. <column xsi:type="decimal" name="base_total_offline_refunded" scale="4" precision="20" unsigned="false"
  74. nullable="true" comment="Base Total Offline Refunded"/>
  75. <column xsi:type="decimal" name="base_total_online_refunded" scale="4" precision="20" unsigned="false"
  76. nullable="true" comment="Base Total Online Refunded"/>
  77. <column xsi:type="decimal" name="base_total_paid" scale="4" precision="20" unsigned="false" nullable="true"
  78. comment="Base Total Paid"/>
  79. <column xsi:type="decimal" name="base_total_qty_ordered" scale="4" precision="12" unsigned="false"
  80. nullable="true" comment="Base Total Qty Ordered"/>
  81. <column xsi:type="decimal" name="base_total_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  82. comment="Base Total Refunded"/>
  83. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="true"
  84. comment="Discount Amount"/>
  85. <column xsi:type="decimal" name="discount_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  86. comment="Discount Canceled"/>
  87. <column xsi:type="decimal" name="discount_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  88. comment="Discount Invoiced"/>
  89. <column xsi:type="decimal" name="discount_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  90. comment="Discount Refunded"/>
  91. <column xsi:type="decimal" name="grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  92. comment="Grand Total"/>
  93. <column xsi:type="decimal" name="shipping_amount" scale="4" precision="20" unsigned="false" nullable="true"
  94. comment="Shipping Amount"/>
  95. <column xsi:type="decimal" name="shipping_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  96. comment="Shipping Canceled"/>
  97. <column xsi:type="decimal" name="shipping_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  98. comment="Shipping Invoiced"/>
  99. <column xsi:type="decimal" name="shipping_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  100. comment="Shipping Refunded"/>
  101. <column xsi:type="decimal" name="shipping_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  102. comment="Shipping Tax Amount"/>
  103. <column xsi:type="decimal" name="shipping_tax_refunded" scale="4" precision="20" unsigned="false"
  104. nullable="true" comment="Shipping Tax Refunded"/>
  105. <column xsi:type="decimal" name="store_to_base_rate" scale="4" precision="12" unsigned="false" nullable="true"
  106. comment="Store To Base Rate"/>
  107. <column xsi:type="decimal" name="store_to_order_rate" scale="4" precision="12" unsigned="false" nullable="true"
  108. comment="Store To Order Rate"/>
  109. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  110. comment="Subtotal"/>
  111. <column xsi:type="decimal" name="subtotal_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  112. comment="Subtotal Canceled"/>
  113. <column xsi:type="decimal" name="subtotal_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  114. comment="Subtotal Invoiced"/>
  115. <column xsi:type="decimal" name="subtotal_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  116. comment="Subtotal Refunded"/>
  117. <column xsi:type="decimal" name="tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  118. comment="Tax Amount"/>
  119. <column xsi:type="decimal" name="tax_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  120. comment="Tax Canceled"/>
  121. <column xsi:type="decimal" name="tax_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  122. comment="Tax Invoiced"/>
  123. <column xsi:type="decimal" name="tax_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  124. comment="Tax Refunded"/>
  125. <column xsi:type="decimal" name="total_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  126. comment="Total Canceled"/>
  127. <column xsi:type="decimal" name="total_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  128. comment="Total Invoiced"/>
  129. <column xsi:type="decimal" name="total_offline_refunded" scale="4" precision="20" unsigned="false"
  130. nullable="true" comment="Total Offline Refunded"/>
  131. <column xsi:type="decimal" name="total_online_refunded" scale="4" precision="20" unsigned="false"
  132. nullable="true" comment="Total Online Refunded"/>
  133. <column xsi:type="decimal" name="total_paid" scale="4" precision="20" unsigned="false" nullable="true"
  134. comment="Total Paid"/>
  135. <column xsi:type="decimal" name="total_qty_ordered" scale="4" precision="12" unsigned="false" nullable="true"
  136. comment="Total Qty Ordered"/>
  137. <column xsi:type="decimal" name="total_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  138. comment="Total Refunded"/>
  139. <column xsi:type="smallint" name="can_ship_partially" unsigned="true" nullable="true"
  140. identity="false" comment="Can Ship Partially"/>
  141. <column xsi:type="smallint" name="can_ship_partially_item" unsigned="true" nullable="true"
  142. identity="false" comment="Can Ship Partially Item"/>
  143. <column xsi:type="smallint" name="customer_is_guest" unsigned="true" nullable="true"
  144. identity="false" comment="Customer Is Guest"/>
  145. <column xsi:type="smallint" name="customer_note_notify" unsigned="true" nullable="true"
  146. identity="false" comment="Customer Note Notify"/>
  147. <column xsi:type="int" name="billing_address_id" unsigned="false" nullable="true" identity="false"
  148. comment="Billing Address ID"/>
  149. <column xsi:type="int" name="customer_group_id" unsigned="false" nullable="true" identity="false"/>
  150. <column xsi:type="int" name="edit_increment" unsigned="false" nullable="true" identity="false"
  151. comment="Edit Increment"/>
  152. <column xsi:type="smallint" name="email_sent" unsigned="true" nullable="true" identity="false"
  153. comment="Email Sent"/>
  154. <column xsi:type="smallint" name="send_email" unsigned="true" nullable="true" identity="false"
  155. comment="Send Email"/>
  156. <column xsi:type="smallint" name="forced_shipment_with_invoice" unsigned="true" nullable="true"
  157. identity="false" comment="Forced Do Shipment With Invoice"/>
  158. <column xsi:type="int" name="payment_auth_expiration" unsigned="false" nullable="true"
  159. identity="false" comment="Payment Authorization Expiration"/>
  160. <column xsi:type="int" name="quote_address_id" unsigned="false" nullable="true" identity="false"
  161. comment="Quote Address ID"/>
  162. <column xsi:type="int" name="quote_id" unsigned="false" nullable="true" identity="false"
  163. comment="Quote ID"/>
  164. <column xsi:type="int" name="shipping_address_id" unsigned="false" nullable="true" identity="false"
  165. comment="Shipping Address ID"/>
  166. <column xsi:type="decimal" name="adjustment_negative" scale="4" precision="20" unsigned="false" nullable="true"
  167. comment="Adjustment Negative"/>
  168. <column xsi:type="decimal" name="adjustment_positive" scale="4" precision="20" unsigned="false" nullable="true"
  169. comment="Adjustment Positive"/>
  170. <column xsi:type="decimal" name="base_adjustment_negative" scale="4" precision="20" unsigned="false"
  171. nullable="true" comment="Base Adjustment Negative"/>
  172. <column xsi:type="decimal" name="base_adjustment_positive" scale="4" precision="20" unsigned="false"
  173. nullable="true" comment="Base Adjustment Positive"/>
  174. <column xsi:type="decimal" name="base_shipping_discount_amount" scale="4" precision="20" unsigned="false"
  175. nullable="true" comment="Base Shipping Discount Amount"/>
  176. <column xsi:type="decimal" name="base_subtotal_incl_tax" scale="4" precision="20" unsigned="false"
  177. nullable="true" comment="Base Subtotal Incl Tax"/>
  178. <column xsi:type="decimal" name="base_total_due" scale="4" precision="20" unsigned="false" nullable="true"
  179. comment="Base Total Due"/>
  180. <column xsi:type="decimal" name="payment_authorization_amount" scale="4" precision="20" unsigned="false"
  181. nullable="true" comment="Payment Authorization Amount"/>
  182. <column xsi:type="decimal" name="shipping_discount_amount" scale="4" precision="20" unsigned="false"
  183. nullable="true" comment="Shipping Discount Amount"/>
  184. <column xsi:type="decimal" name="subtotal_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  185. comment="Subtotal Incl Tax"/>
  186. <column xsi:type="decimal" name="total_due" scale="4" precision="20" unsigned="false" nullable="true"
  187. comment="Total Due"/>
  188. <column xsi:type="decimal" name="weight" scale="4" precision="12" unsigned="false" nullable="true"
  189. comment="Weight"/>
  190. <column xsi:type="datetime" name="customer_dob" on_update="false" nullable="true" comment="Customer Dob"/>
  191. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  192. <column xsi:type="varchar" name="applied_rule_ids" nullable="true" length="128" comment="Applied Rule Ids"/>
  193. <column xsi:type="varchar" name="base_currency_code" nullable="true" length="3" comment="Base Currency Code"/>
  194. <column xsi:type="varchar" name="customer_email" nullable="true" length="128" comment="Customer Email"/>
  195. <column xsi:type="varchar" name="customer_firstname" nullable="true" length="128" comment="Customer Firstname"/>
  196. <column xsi:type="varchar" name="customer_lastname" nullable="true" length="128" comment="Customer Lastname"/>
  197. <column xsi:type="varchar" name="customer_middlename" nullable="true" length="128"
  198. comment="Customer Middlename"/>
  199. <column xsi:type="varchar" name="customer_prefix" nullable="true" length="32" comment="Customer Prefix"/>
  200. <column xsi:type="varchar" name="customer_suffix" nullable="true" length="32" comment="Customer Suffix"/>
  201. <column xsi:type="varchar" name="customer_taxvat" nullable="true" length="32" comment="Customer Taxvat"/>
  202. <column xsi:type="varchar" name="discount_description" nullable="true" length="255"
  203. comment="Discount Description"/>
  204. <column xsi:type="varchar" name="ext_customer_id" nullable="true" length="32" comment="Ext Customer ID"/>
  205. <column xsi:type="varchar" name="ext_order_id" nullable="true" length="32" comment="Ext Order ID"/>
  206. <column xsi:type="varchar" name="global_currency_code" nullable="true" length="3"
  207. comment="Global Currency Code"/>
  208. <column xsi:type="varchar" name="hold_before_state" nullable="true" length="32" comment="Hold Before State"/>
  209. <column xsi:type="varchar" name="hold_before_status" nullable="true" length="32" comment="Hold Before Status"/>
  210. <column xsi:type="varchar" name="order_currency_code" nullable="true" length="3" comment="Order Currency Code"/>
  211. <column xsi:type="varchar" name="original_increment_id" nullable="true" length="50"
  212. comment="Original Increment ID"/>
  213. <column xsi:type="varchar" name="relation_child_id" nullable="true" length="32" comment="Relation Child ID"/>
  214. <column xsi:type="varchar" name="relation_child_real_id" nullable="true" length="32"
  215. comment="Relation Child Real ID"/>
  216. <column xsi:type="varchar" name="relation_parent_id" nullable="true" length="32" comment="Relation Parent ID"/>
  217. <column xsi:type="varchar" name="relation_parent_real_id" nullable="true" length="32"
  218. comment="Relation Parent Real ID"/>
  219. <column xsi:type="varchar" name="remote_ip" nullable="true" length="45" comment="Remote Ip"/>
  220. <column xsi:type="varchar" name="shipping_method" nullable="true" length="120"/>
  221. <column xsi:type="varchar" name="store_currency_code" nullable="true" length="3" comment="Store Currency Code"/>
  222. <column xsi:type="varchar" name="store_name" nullable="true" length="255" comment="Store Name"/>
  223. <column xsi:type="varchar" name="x_forwarded_for" nullable="true" length="255" comment="X Forwarded For"/>
  224. <column xsi:type="text" name="customer_note" nullable="true" comment="Customer Note"/>
  225. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  226. comment="Created At"/>
  227. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  228. comment="Updated At"/>
  229. <column xsi:type="smallint" name="total_item_count" unsigned="true" nullable="false"
  230. identity="false" default="0" comment="Total Item Count"/>
  231. <column xsi:type="int" name="customer_gender" unsigned="false" nullable="true" identity="false"
  232. comment="Customer Gender"/>
  233. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="20" unsigned="false"
  234. nullable="true" comment="Discount Tax Compensation Amount"/>
  235. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="20"
  236. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  237. <column xsi:type="decimal" name="shipping_discount_tax_compensation_amount" scale="4" precision="20"
  238. unsigned="false" nullable="true" comment="Shipping Discount Tax Compensation Amount"/>
  239. <column xsi:type="decimal" name="base_shipping_discount_tax_compensation_amnt" scale="4" precision="20"
  240. unsigned="false" nullable="true" comment="Base Shipping Discount Tax Compensation Amount"/>
  241. <column xsi:type="decimal" name="discount_tax_compensation_invoiced" scale="4" precision="20" unsigned="false"
  242. nullable="true" comment="Discount Tax Compensation Invoiced"/>
  243. <column xsi:type="decimal" name="base_discount_tax_compensation_invoiced" scale="4" precision="20"
  244. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Invoiced"/>
  245. <column xsi:type="decimal" name="discount_tax_compensation_refunded" scale="4" precision="20" unsigned="false"
  246. nullable="true" comment="Discount Tax Compensation Refunded"/>
  247. <column xsi:type="decimal" name="base_discount_tax_compensation_refunded" scale="4" precision="20"
  248. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Refunded"/>
  249. <column xsi:type="decimal" name="shipping_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  250. comment="Shipping Incl Tax"/>
  251. <column xsi:type="decimal" name="base_shipping_incl_tax" scale="4" precision="20" unsigned="false"
  252. nullable="true" comment="Base Shipping Incl Tax"/>
  253. <column xsi:type="varchar" name="coupon_rule_name" nullable="true" length="255"
  254. comment="Coupon Sales Rule Name"/>
  255. <constraint xsi:type="primary" referenceId="PRIMARY">
  256. <column name="entity_id"/>
  257. </constraint>
  258. <constraint xsi:type="foreign" referenceId="SALES_ORDER_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="sales_order"
  259. column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id"
  260. onDelete="SET NULL"/>
  261. <constraint xsi:type="foreign" referenceId="SALES_ORDER_STORE_ID_STORE_STORE_ID" table="sales_order" column="store_id"
  262. referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  263. <constraint xsi:type="unique" referenceId="SALES_ORDER_INCREMENT_ID_STORE_ID">
  264. <column name="increment_id"/>
  265. <column name="store_id"/>
  266. </constraint>
  267. <index referenceId="SALES_ORDER_STATUS" indexType="btree">
  268. <column name="status"/>
  269. </index>
  270. <index referenceId="SALES_ORDER_STATE" indexType="btree">
  271. <column name="state"/>
  272. </index>
  273. <index referenceId="SALES_ORDER_STORE_ID" indexType="btree">
  274. <column name="store_id"/>
  275. </index>
  276. <index referenceId="SALES_ORDER_CREATED_AT" indexType="btree">
  277. <column name="created_at"/>
  278. </index>
  279. <index referenceId="SALES_ORDER_CUSTOMER_ID" indexType="btree">
  280. <column name="customer_id"/>
  281. </index>
  282. <index referenceId="SALES_ORDER_EXT_ORDER_ID" indexType="btree">
  283. <column name="ext_order_id"/>
  284. </index>
  285. <index referenceId="SALES_ORDER_QUOTE_ID" indexType="btree">
  286. <column name="quote_id"/>
  287. </index>
  288. <index referenceId="SALES_ORDER_UPDATED_AT" indexType="btree">
  289. <column name="updated_at"/>
  290. </index>
  291. <index referenceId="SALES_ORDER_SEND_EMAIL" indexType="btree">
  292. <column name="send_email"/>
  293. </index>
  294. <index referenceId="SALES_ORDER_EMAIL_SENT" indexType="btree">
  295. <column name="email_sent"/>
  296. </index>
  297. </table>
  298. <table name="sales_order_grid" resource="sales" engine="innodb" comment="Sales Flat Order Grid">
  299. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="false"
  300. comment="Entity ID"/>
  301. <column xsi:type="varchar" name="status" nullable="true" length="32" comment="Status"/>
  302. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  303. comment="Store ID"/>
  304. <column xsi:type="varchar" name="store_name" nullable="true" length="255" comment="Store Name"/>
  305. <column xsi:type="int" name="customer_id" unsigned="true" nullable="true" identity="false"
  306. comment="Customer ID"/>
  307. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  308. comment="Base Grand Total"/>
  309. <column xsi:type="decimal" name="base_total_paid" scale="4" precision="20" unsigned="false" nullable="true"
  310. comment="Base Total Paid"/>
  311. <column xsi:type="decimal" name="grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  312. comment="Grand Total"/>
  313. <column xsi:type="decimal" name="total_paid" scale="4" precision="20" unsigned="false" nullable="true"
  314. comment="Total Paid"/>
  315. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  316. <column xsi:type="varchar" name="base_currency_code" nullable="true" length="3" comment="Base Currency Code"/>
  317. <column xsi:type="varchar" name="order_currency_code" nullable="true" length="255"
  318. comment="Order Currency Code"/>
  319. <column xsi:type="varchar" name="shipping_name" nullable="true" length="255" comment="Shipping Name"/>
  320. <column xsi:type="varchar" name="billing_name" nullable="true" length="255" comment="Billing Name"/>
  321. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created At"/>
  322. <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated At"/>
  323. <column xsi:type="varchar" name="billing_address" nullable="true" length="255" comment="Billing Address"/>
  324. <column xsi:type="varchar" name="shipping_address" nullable="true" length="255" comment="Shipping Address"/>
  325. <column xsi:type="varchar" name="shipping_information" nullable="true" length="255"
  326. comment="Shipping Method Name"/>
  327. <column xsi:type="varchar" name="customer_email" nullable="true" length="255" comment="Customer Email"/>
  328. <column xsi:type="varchar" name="customer_group" nullable="true" length="255" comment="Customer Group"/>
  329. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  330. comment="Subtotal"/>
  331. <column xsi:type="decimal" name="shipping_and_handling" scale="4" precision="20" unsigned="false"
  332. nullable="true" comment="Shipping and handling amount"/>
  333. <column xsi:type="varchar" name="customer_name" nullable="true" length="255" comment="Customer Name"/>
  334. <column xsi:type="varchar" name="payment_method" nullable="true" length="255" comment="Payment Method"/>
  335. <column xsi:type="decimal" name="total_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  336. comment="Total Refunded"/>
  337. <constraint xsi:type="primary" referenceId="PRIMARY">
  338. <column name="entity_id"/>
  339. </constraint>
  340. <constraint xsi:type="unique" referenceId="SALES_ORDER_GRID_INCREMENT_ID_STORE_ID">
  341. <column name="increment_id"/>
  342. <column name="store_id"/>
  343. </constraint>
  344. <index referenceId="SALES_ORDER_GRID_STATUS" indexType="btree">
  345. <column name="status"/>
  346. </index>
  347. <index referenceId="SALES_ORDER_GRID_STORE_ID" indexType="btree">
  348. <column name="store_id"/>
  349. </index>
  350. <index referenceId="SALES_ORDER_GRID_BASE_GRAND_TOTAL" indexType="btree">
  351. <column name="base_grand_total"/>
  352. </index>
  353. <index referenceId="SALES_ORDER_GRID_BASE_TOTAL_PAID" indexType="btree">
  354. <column name="base_total_paid"/>
  355. </index>
  356. <index referenceId="SALES_ORDER_GRID_GRAND_TOTAL" indexType="btree">
  357. <column name="grand_total"/>
  358. </index>
  359. <index referenceId="SALES_ORDER_GRID_TOTAL_PAID" indexType="btree">
  360. <column name="total_paid"/>
  361. </index>
  362. <index referenceId="SALES_ORDER_GRID_SHIPPING_NAME" indexType="btree">
  363. <column name="shipping_name"/>
  364. </index>
  365. <index referenceId="SALES_ORDER_GRID_BILLING_NAME" indexType="btree">
  366. <column name="billing_name"/>
  367. </index>
  368. <index referenceId="SALES_ORDER_GRID_CREATED_AT" indexType="btree">
  369. <column name="created_at"/>
  370. </index>
  371. <index referenceId="SALES_ORDER_GRID_CUSTOMER_ID" indexType="btree">
  372. <column name="customer_id"/>
  373. </index>
  374. <index referenceId="SALES_ORDER_GRID_UPDATED_AT" indexType="btree">
  375. <column name="updated_at"/>
  376. </index>
  377. <index referenceId="FTI_65B9E9925EC58F0C7C2E2F6379C233E7" indexType="fulltext">
  378. <column name="increment_id"/>
  379. <column name="billing_name"/>
  380. <column name="shipping_name"/>
  381. <column name="shipping_address"/>
  382. <column name="billing_address"/>
  383. <column name="customer_name"/>
  384. <column name="customer_email"/>
  385. </index>
  386. </table>
  387. <table name="sales_order_address" resource="sales" engine="innodb" comment="Sales Flat Order Address">
  388. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  389. comment="Entity ID"/>
  390. <column xsi:type="int" name="parent_id" unsigned="true" nullable="true" identity="false"
  391. comment="Parent ID"/>
  392. <column xsi:type="int" name="customer_address_id" unsigned="false" nullable="true" identity="false"
  393. comment="Customer Address ID"/>
  394. <column xsi:type="int" name="quote_address_id" unsigned="false" nullable="true" identity="false"
  395. comment="Quote Address ID"/>
  396. <column xsi:type="int" name="region_id" unsigned="false" nullable="true" identity="false"
  397. comment="Region ID"/>
  398. <column xsi:type="int" name="customer_id" unsigned="false" nullable="true" identity="false"
  399. comment="Customer ID"/>
  400. <column xsi:type="varchar" name="fax" nullable="true" length="255" comment="Fax"/>
  401. <column xsi:type="varchar" name="region" nullable="true" length="255" comment="Region"/>
  402. <column xsi:type="varchar" name="postcode" nullable="true" length="255" comment="Postcode"/>
  403. <column xsi:type="varchar" name="lastname" nullable="true" length="255" comment="Lastname"/>
  404. <column xsi:type="varchar" name="street" nullable="true" length="255" comment="Street"/>
  405. <column xsi:type="varchar" name="city" nullable="true" length="255" comment="City"/>
  406. <column xsi:type="varchar" name="email" nullable="true" length="255" comment="Email"/>
  407. <column xsi:type="varchar" name="telephone" nullable="true" length="255" comment="Phone Number"/>
  408. <column xsi:type="varchar" name="country_id" nullable="true" length="2" comment="Country ID"/>
  409. <column xsi:type="varchar" name="firstname" nullable="true" length="255" comment="Firstname"/>
  410. <column xsi:type="varchar" name="address_type" nullable="true" length="255" comment="Address Type"/>
  411. <column xsi:type="varchar" name="prefix" nullable="true" length="255" comment="Prefix"/>
  412. <column xsi:type="varchar" name="middlename" nullable="true" length="255" comment="Middlename"/>
  413. <column xsi:type="varchar" name="suffix" nullable="true" length="255" comment="Suffix"/>
  414. <column xsi:type="varchar" name="company" nullable="true" length="255" comment="Company"/>
  415. <column xsi:type="text" name="vat_id" nullable="true" comment="Vat ID"/>
  416. <column xsi:type="smallint" name="vat_is_valid" unsigned="false" nullable="true" identity="false"
  417. comment="Vat Is Valid"/>
  418. <column xsi:type="text" name="vat_request_id" nullable="true" comment="Vat Request ID"/>
  419. <column xsi:type="text" name="vat_request_date" nullable="true" comment="Vat Request Date"/>
  420. <column xsi:type="smallint" name="vat_request_success" unsigned="false" nullable="true"
  421. identity="false" comment="Vat Request Success"/>
  422. <constraint xsi:type="primary" referenceId="PRIMARY">
  423. <column name="entity_id"/>
  424. </constraint>
  425. <constraint xsi:type="foreign" referenceId="SALES_ORDER_ADDRESS_PARENT_ID_SALES_ORDER_ENTITY_ID"
  426. table="sales_order_address" column="parent_id" referenceTable="sales_order"
  427. referenceColumn="entity_id" onDelete="CASCADE"/>
  428. <index referenceId="SALES_ORDER_ADDRESS_PARENT_ID" indexType="btree">
  429. <column name="parent_id"/>
  430. </index>
  431. </table>
  432. <table name="sales_order_status_history" resource="sales" engine="innodb" comment="Sales Flat Order Status History">
  433. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  434. comment="Entity ID"/>
  435. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  436. comment="Parent ID"/>
  437. <column xsi:type="int" name="is_customer_notified" unsigned="false" nullable="true"
  438. identity="false" comment="Is Customer Notified"/>
  439. <column xsi:type="smallint" name="is_visible_on_front" unsigned="true" nullable="false"
  440. identity="false" default="0" comment="Is Visible On Front"/>
  441. <column xsi:type="text" name="comment" nullable="true" comment="Comment"/>
  442. <column xsi:type="varchar" name="status" nullable="true" length="32" comment="Status"/>
  443. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  444. comment="Created At"/>
  445. <column xsi:type="varchar" name="entity_name" nullable="true" length="32"
  446. comment="Shows what entity history is bind to."/>
  447. <constraint xsi:type="primary" referenceId="PRIMARY">
  448. <column name="entity_id"/>
  449. </constraint>
  450. <constraint xsi:type="foreign" referenceId="SALES_ORDER_STATUS_HISTORY_PARENT_ID_SALES_ORDER_ENTITY_ID"
  451. table="sales_order_status_history" column="parent_id" referenceTable="sales_order"
  452. referenceColumn="entity_id" onDelete="CASCADE"/>
  453. <index referenceId="SALES_ORDER_STATUS_HISTORY_PARENT_ID" indexType="btree">
  454. <column name="parent_id"/>
  455. </index>
  456. <index referenceId="SALES_ORDER_STATUS_HISTORY_CREATED_AT" indexType="btree">
  457. <column name="created_at"/>
  458. </index>
  459. </table>
  460. <table name="sales_order_item" resource="sales" engine="innodb" comment="Sales Flat Order Item">
  461. <column xsi:type="int" name="item_id" unsigned="true" nullable="false" identity="true"
  462. comment="Item ID"/>
  463. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  464. default="0" comment="Order ID"/>
  465. <column xsi:type="int" name="parent_item_id" unsigned="true" nullable="true" identity="false"
  466. comment="Parent Item ID"/>
  467. <column xsi:type="int" name="quote_item_id" unsigned="true" nullable="true" identity="false"
  468. comment="Quote Item ID"/>
  469. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  470. comment="Store 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="CURRENT_TIMESTAMP"
  474. comment="Updated At"/>
  475. <column xsi:type="int" name="product_id" unsigned="true" nullable="true" identity="false"
  476. comment="Product ID"/>
  477. <column xsi:type="varchar" name="product_type" nullable="true" length="255" comment="Product Type"/>
  478. <column xsi:type="text" name="product_options" nullable="true" comment="Product Options"/>
  479. <column xsi:type="decimal" name="weight" scale="4" precision="12" unsigned="false" nullable="true" default="0"
  480. comment="Weight"/>
  481. <column xsi:type="smallint" name="is_virtual" unsigned="true" nullable="true" identity="false"
  482. comment="Is Virtual"/>
  483. <column xsi:type="varchar" name="sku" nullable="true" length="255" comment="Sku"/>
  484. <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
  485. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  486. <column xsi:type="text" name="applied_rule_ids" nullable="true" comment="Applied Rule Ids"/>
  487. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  488. <column xsi:type="smallint" name="is_qty_decimal" unsigned="true" nullable="true" identity="false"
  489. comment="Is Qty Decimal"/>
  490. <column xsi:type="smallint" name="no_discount" unsigned="true" nullable="false" identity="false"
  491. default="0" comment="No Discount"/>
  492. <column xsi:type="decimal" name="qty_backordered" scale="4" precision="12" unsigned="false" nullable="true"
  493. default="0" comment="Qty Backordered"/>
  494. <column xsi:type="decimal" name="qty_canceled" scale="4" precision="12" unsigned="false" nullable="true"
  495. default="0" comment="Qty Canceled"/>
  496. <column xsi:type="decimal" name="qty_invoiced" scale="4" precision="12" unsigned="false" nullable="true"
  497. default="0" comment="Qty Invoiced"/>
  498. <column xsi:type="decimal" name="qty_ordered" scale="4" precision="12" unsigned="false" nullable="true"
  499. default="0" comment="Qty Ordered"/>
  500. <column xsi:type="decimal" name="qty_refunded" scale="4" precision="12" unsigned="false" nullable="true"
  501. default="0" comment="Qty Refunded"/>
  502. <column xsi:type="decimal" name="qty_shipped" scale="4" precision="12" unsigned="false" nullable="true"
  503. default="0" comment="Qty Shipped"/>
  504. <column xsi:type="decimal" name="base_cost" scale="4" precision="12" unsigned="false" nullable="true"
  505. default="0" comment="Base Cost"/>
  506. <column xsi:type="decimal" name="price" scale="4" precision="12" unsigned="false" nullable="false" default="0"
  507. comment="Price"/>
  508. <column xsi:type="decimal" name="base_price" scale="4" precision="12" unsigned="false" nullable="false"
  509. default="0" comment="Base Price"/>
  510. <column xsi:type="decimal" name="original_price" scale="4" precision="12" unsigned="false" nullable="true"
  511. comment="Original Price"/>
  512. <column xsi:type="decimal" name="base_original_price" scale="4" precision="12" unsigned="false" nullable="true"
  513. comment="Base Original Price"/>
  514. <column xsi:type="decimal" name="tax_percent" scale="4" precision="12" unsigned="false" nullable="true"
  515. default="0" comment="Tax Percent"/>
  516. <column xsi:type="decimal" name="tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  517. default="0" comment="Tax Amount"/>
  518. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  519. default="0" comment="Base Tax Amount"/>
  520. <column xsi:type="decimal" name="tax_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  521. default="0" comment="Tax Invoiced"/>
  522. <column xsi:type="decimal" name="base_tax_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  523. default="0" comment="Base Tax Invoiced"/>
  524. <column xsi:type="decimal" name="discount_percent" scale="4" precision="12" unsigned="false" nullable="true"
  525. default="0" comment="Discount Percent"/>
  526. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="true"
  527. default="0" comment="Discount Amount"/>
  528. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="20" unsigned="false"
  529. nullable="true" default="0" comment="Base Discount Amount"/>
  530. <column xsi:type="decimal" name="discount_invoiced" scale="4" precision="20" unsigned="false" nullable="true"
  531. default="0" comment="Discount Invoiced"/>
  532. <column xsi:type="decimal" name="base_discount_invoiced" scale="4" precision="20" unsigned="false"
  533. nullable="true" default="0" comment="Base Discount Invoiced"/>
  534. <column xsi:type="decimal" name="amount_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  535. default="0" comment="Amount Refunded"/>
  536. <column xsi:type="decimal" name="base_amount_refunded" scale="4" precision="20" unsigned="false"
  537. nullable="true" default="0" comment="Base Amount Refunded"/>
  538. <column xsi:type="decimal" name="row_total" scale="4" precision="20" unsigned="false" nullable="false"
  539. default="0" comment="Row Total"/>
  540. <column xsi:type="decimal" name="base_row_total" scale="4" precision="20" unsigned="false" nullable="false"
  541. default="0" comment="Base Row Total"/>
  542. <column xsi:type="decimal" name="row_invoiced" scale="4" precision="20" unsigned="false" nullable="false"
  543. default="0" comment="Row Invoiced"/>
  544. <column xsi:type="decimal" name="base_row_invoiced" scale="4" precision="20" unsigned="false" nullable="false"
  545. default="0" comment="Base Row Invoiced"/>
  546. <column xsi:type="decimal" name="row_weight" scale="4" precision="12" unsigned="false" nullable="true"
  547. default="0" comment="Row Weight"/>
  548. <column xsi:type="decimal" name="base_tax_before_discount" scale="4" precision="20" unsigned="false"
  549. nullable="true" comment="Base Tax Before Discount"/>
  550. <column xsi:type="decimal" name="tax_before_discount" scale="4" precision="20" unsigned="false" nullable="true"
  551. comment="Tax Before Discount"/>
  552. <column xsi:type="varchar" name="ext_order_item_id" nullable="true" length="255" comment="Ext Order Item ID"/>
  553. <column xsi:type="smallint" name="locked_do_invoice" unsigned="true" nullable="true"
  554. identity="false" comment="Locked Do Invoice"/>
  555. <column xsi:type="smallint" name="locked_do_ship" unsigned="true" nullable="true" identity="false"
  556. comment="Locked Do Ship"/>
  557. <column xsi:type="decimal" name="price_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  558. comment="Price Incl Tax"/>
  559. <column xsi:type="decimal" name="base_price_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  560. comment="Base Price Incl Tax"/>
  561. <column xsi:type="decimal" name="row_total_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  562. comment="Row Total Incl Tax"/>
  563. <column xsi:type="decimal" name="base_row_total_incl_tax" scale="4" precision="20" unsigned="false"
  564. nullable="true" comment="Base Row Total Incl Tax"/>
  565. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="20" unsigned="false"
  566. nullable="true" comment="Discount Tax Compensation Amount"/>
  567. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="20"
  568. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  569. <column xsi:type="decimal" name="discount_tax_compensation_invoiced" scale="4" precision="20" unsigned="false"
  570. nullable="true" comment="Discount Tax Compensation Invoiced"/>
  571. <column xsi:type="decimal" name="base_discount_tax_compensation_invoiced" scale="4" precision="20"
  572. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Invoiced"/>
  573. <column xsi:type="decimal" name="discount_tax_compensation_refunded" scale="4" precision="20" unsigned="false"
  574. nullable="true" comment="Discount Tax Compensation Refunded"/>
  575. <column xsi:type="decimal" name="base_discount_tax_compensation_refunded" scale="4" precision="20"
  576. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Refunded"/>
  577. <column xsi:type="decimal" name="tax_canceled" scale="4" precision="12" unsigned="false" nullable="true"
  578. comment="Tax Canceled"/>
  579. <column xsi:type="decimal" name="discount_tax_compensation_canceled" scale="4" precision="20" unsigned="false"
  580. nullable="true" comment="Discount Tax Compensation Canceled"/>
  581. <column xsi:type="decimal" name="tax_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  582. comment="Tax Refunded"/>
  583. <column xsi:type="decimal" name="base_tax_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  584. comment="Base Tax Refunded"/>
  585. <column xsi:type="decimal" name="discount_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  586. comment="Discount Refunded"/>
  587. <column xsi:type="decimal" name="base_discount_refunded" scale="4" precision="20" unsigned="false"
  588. nullable="true" comment="Base Discount Refunded"/>
  589. <constraint xsi:type="primary" referenceId="PRIMARY">
  590. <column name="item_id"/>
  591. </constraint>
  592. <constraint xsi:type="foreign" referenceId="SALES_ORDER_ITEM_ORDER_ID_SALES_ORDER_ENTITY_ID" table="sales_order_item"
  593. column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="CASCADE"/>
  594. <constraint xsi:type="foreign" referenceId="SALES_ORDER_ITEM_STORE_ID_STORE_STORE_ID" table="sales_order_item"
  595. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  596. <index referenceId="SALES_ORDER_ITEM_ORDER_ID" indexType="btree">
  597. <column name="order_id"/>
  598. </index>
  599. <index referenceId="SALES_ORDER_ITEM_STORE_ID" indexType="btree">
  600. <column name="store_id"/>
  601. </index>
  602. </table>
  603. <table name="sales_order_payment" resource="sales" engine="innodb" comment="Sales Flat Order Payment">
  604. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  605. comment="Entity ID"/>
  606. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  607. comment="Parent ID"/>
  608. <column xsi:type="decimal" name="base_shipping_captured" scale="4" precision="20" unsigned="false"
  609. nullable="true" comment="Base Shipping Captured"/>
  610. <column xsi:type="decimal" name="shipping_captured" scale="4" precision="20" unsigned="false" nullable="true"
  611. comment="Shipping Captured"/>
  612. <column xsi:type="decimal" name="amount_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  613. comment="Amount Refunded"/>
  614. <column xsi:type="decimal" name="base_amount_paid" scale="4" precision="20" unsigned="false" nullable="true"
  615. comment="Base Amount Paid"/>
  616. <column xsi:type="decimal" name="amount_canceled" scale="4" precision="20" unsigned="false" nullable="true"
  617. comment="Amount Canceled"/>
  618. <column xsi:type="decimal" name="base_amount_authorized" scale="4" precision="20" unsigned="false"
  619. nullable="true" comment="Base Amount Authorized"/>
  620. <column xsi:type="decimal" name="base_amount_paid_online" scale="4" precision="20" unsigned="false"
  621. nullable="true" comment="Base Amount Paid Online"/>
  622. <column xsi:type="decimal" name="base_amount_refunded_online" scale="4" precision="20" unsigned="false"
  623. nullable="true" comment="Base Amount Refunded Online"/>
  624. <column xsi:type="decimal" name="base_shipping_amount" scale="4" precision="20" unsigned="false"
  625. nullable="true" comment="Base Shipping Amount"/>
  626. <column xsi:type="decimal" name="shipping_amount" scale="4" precision="20" unsigned="false" nullable="true"
  627. comment="Shipping Amount"/>
  628. <column xsi:type="decimal" name="amount_paid" scale="4" precision="20" unsigned="false" nullable="true"
  629. comment="Amount Paid"/>
  630. <column xsi:type="decimal" name="amount_authorized" scale="4" precision="20" unsigned="false" nullable="true"
  631. comment="Amount Authorized"/>
  632. <column xsi:type="decimal" name="base_amount_ordered" scale="4" precision="20" unsigned="false" nullable="true"
  633. comment="Base Amount Ordered"/>
  634. <column xsi:type="decimal" name="base_shipping_refunded" scale="4" precision="20" unsigned="false"
  635. nullable="true" comment="Base Shipping Refunded"/>
  636. <column xsi:type="decimal" name="shipping_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  637. comment="Shipping Refunded"/>
  638. <column xsi:type="decimal" name="base_amount_refunded" scale="4" precision="20" unsigned="false"
  639. nullable="true" comment="Base Amount Refunded"/>
  640. <column xsi:type="decimal" name="amount_ordered" scale="4" precision="20" unsigned="false" nullable="true"
  641. comment="Amount Ordered"/>
  642. <column xsi:type="decimal" name="base_amount_canceled" scale="4" precision="20" unsigned="false"
  643. nullable="true" comment="Base Amount Canceled"/>
  644. <column xsi:type="int" name="quote_payment_id" unsigned="false" nullable="true" identity="false"
  645. comment="Quote Payment ID"/>
  646. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  647. <column xsi:type="varchar" name="cc_exp_month" nullable="true" length="12" comment="Cc Exp Month"/>
  648. <column xsi:type="varchar" name="cc_ss_start_year" nullable="true" length="12" comment="Cc Ss Start Year"/>
  649. <column xsi:type="varchar" name="echeck_bank_name" nullable="true" length="128" comment="Echeck Bank Name"/>
  650. <column xsi:type="varchar" name="method" nullable="true" length="128" comment="Method"/>
  651. <column xsi:type="varchar" name="cc_debug_request_body" nullable="true" length="32"
  652. comment="Cc Debug Request Body"/>
  653. <column xsi:type="varchar" name="cc_secure_verify" nullable="true" length="32" comment="Cc Secure Verify"/>
  654. <column xsi:type="varchar" name="protection_eligibility" nullable="true" length="32"
  655. comment="Protection Eligibility"/>
  656. <column xsi:type="varchar" name="cc_approval" nullable="true" length="32" comment="Cc Approval"/>
  657. <column xsi:type="varchar" name="cc_last_4" nullable="true" length="100" comment="Cc Last 4"/>
  658. <column xsi:type="varchar" name="cc_status_description" nullable="true" length="32"
  659. comment="Cc Status Description"/>
  660. <column xsi:type="varchar" name="echeck_type" nullable="true" length="32" comment="Echeck Type"/>
  661. <column xsi:type="varchar" name="cc_debug_response_serialized" nullable="true" length="32"
  662. comment="Cc Debug Response Serialized"/>
  663. <column xsi:type="varchar" name="cc_ss_start_month" nullable="true" length="128" comment="Cc Ss Start Month"/>
  664. <column xsi:type="varchar" name="echeck_account_type" nullable="true" length="255"
  665. comment="Echeck Account Type"/>
  666. <column xsi:type="varchar" name="last_trans_id" nullable="true" length="255" comment="Last Trans ID"/>
  667. <column xsi:type="varchar" name="cc_cid_status" nullable="true" length="32" comment="Cc Cid Status"/>
  668. <column xsi:type="varchar" name="cc_owner" nullable="true" length="128" comment="Cc Owner"/>
  669. <column xsi:type="varchar" name="cc_type" nullable="true" length="32" comment="Cc Type"/>
  670. <column xsi:type="varchar" name="po_number" nullable="true" length="32" comment="Po Number"/>
  671. <column xsi:type="varchar" name="cc_exp_year" nullable="true" length="4" comment="Cc Exp Year"/>
  672. <column xsi:type="varchar" name="cc_status" nullable="true" length="4" comment="Cc Status"/>
  673. <column xsi:type="varchar" name="echeck_routing_number" nullable="true" length="32"
  674. comment="Echeck Routing Number"/>
  675. <column xsi:type="varchar" name="account_status" nullable="true" length="32" comment="Account Status"/>
  676. <column xsi:type="varchar" name="anet_trans_method" nullable="true" length="32" comment="Anet Trans Method"/>
  677. <column xsi:type="varchar" name="cc_debug_response_body" nullable="true" length="32"
  678. comment="Cc Debug Response Body"/>
  679. <column xsi:type="varchar" name="cc_ss_issue" nullable="true" length="32" comment="Cc Ss Issue"/>
  680. <column xsi:type="varchar" name="echeck_account_name" nullable="true" length="32"
  681. comment="Echeck Account Name"/>
  682. <column xsi:type="varchar" name="cc_avs_status" nullable="true" length="32" comment="Cc Avs Status"/>
  683. <column xsi:type="varchar" name="cc_number_enc" nullable="true" length="128"/>
  684. <column xsi:type="varchar" name="cc_trans_id" nullable="true" length="32" comment="Cc Trans ID"/>
  685. <column xsi:type="varchar" name="address_status" nullable="true" length="32" comment="Address Status"/>
  686. <column xsi:type="text" name="additional_information" nullable="true" comment="Additional Information"/>
  687. <constraint xsi:type="primary" referenceId="PRIMARY">
  688. <column name="entity_id"/>
  689. </constraint>
  690. <constraint xsi:type="foreign" referenceId="SALES_ORDER_PAYMENT_PARENT_ID_SALES_ORDER_ENTITY_ID"
  691. table="sales_order_payment" column="parent_id" referenceTable="sales_order"
  692. referenceColumn="entity_id" onDelete="CASCADE"/>
  693. <index referenceId="SALES_ORDER_PAYMENT_PARENT_ID" indexType="btree">
  694. <column name="parent_id"/>
  695. </index>
  696. </table>
  697. <table name="sales_shipment" resource="sales" engine="innodb" comment="Sales Flat Shipment">
  698. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  699. comment="Entity ID"/>
  700. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  701. comment="Store ID"/>
  702. <column xsi:type="decimal" name="total_weight" scale="4" precision="12" unsigned="false" nullable="true"
  703. comment="Total Weight"/>
  704. <column xsi:type="decimal" name="total_qty" scale="4" precision="12" unsigned="false" nullable="true"
  705. comment="Total Qty"/>
  706. <column xsi:type="smallint" name="email_sent" unsigned="true" nullable="true" identity="false"
  707. comment="Email Sent"/>
  708. <column xsi:type="smallint" name="send_email" unsigned="true" nullable="true" identity="false"
  709. comment="Send Email"/>
  710. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  711. comment="Order ID"/>
  712. <column xsi:type="int" name="customer_id" unsigned="false" nullable="true" identity="false"
  713. comment="Customer ID"/>
  714. <column xsi:type="int" name="shipping_address_id" unsigned="false" nullable="true" identity="false"
  715. comment="Shipping Address ID"/>
  716. <column xsi:type="int" name="billing_address_id" unsigned="false" nullable="true" identity="false"
  717. comment="Billing Address ID"/>
  718. <column xsi:type="int" name="shipment_status" unsigned="false" nullable="true" identity="false"
  719. comment="Shipment Status"/>
  720. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  721. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  722. comment="Created At"/>
  723. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  724. comment="Updated At"/>
  725. <column xsi:type="text" name="packages" nullable="true" comment="Packed Products in Packages"/>
  726. <column xsi:type="mediumblob" name="shipping_label" nullable="true" comment="Shipping Label Content"/>
  727. <column xsi:type="text" name="customer_note" nullable="true" comment="Customer Note"/>
  728. <column xsi:type="smallint" name="customer_note_notify" unsigned="true" nullable="true"
  729. identity="false" comment="Customer Note Notify"/>
  730. <constraint xsi:type="primary" referenceId="PRIMARY">
  731. <column name="entity_id"/>
  732. </constraint>
  733. <constraint xsi:type="foreign" referenceId="SALES_SHIPMENT_ORDER_ID_SALES_ORDER_ENTITY_ID" table="sales_shipment"
  734. column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="CASCADE"/>
  735. <constraint xsi:type="foreign" referenceId="SALES_SHIPMENT_STORE_ID_STORE_STORE_ID" table="sales_shipment"
  736. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  737. <constraint xsi:type="unique" referenceId="SALES_SHIPMENT_INCREMENT_ID_STORE_ID">
  738. <column name="increment_id"/>
  739. <column name="store_id"/>
  740. </constraint>
  741. <index referenceId="SALES_SHIPMENT_STORE_ID" indexType="btree">
  742. <column name="store_id"/>
  743. </index>
  744. <index referenceId="SALES_SHIPMENT_TOTAL_QTY" indexType="btree">
  745. <column name="total_qty"/>
  746. </index>
  747. <index referenceId="SALES_SHIPMENT_ORDER_ID" indexType="btree">
  748. <column name="order_id"/>
  749. </index>
  750. <index referenceId="SALES_SHIPMENT_CREATED_AT" indexType="btree">
  751. <column name="created_at"/>
  752. </index>
  753. <index referenceId="SALES_SHIPMENT_UPDATED_AT" indexType="btree">
  754. <column name="updated_at"/>
  755. </index>
  756. <index referenceId="SALES_SHIPMENT_SEND_EMAIL" indexType="btree">
  757. <column name="send_email"/>
  758. </index>
  759. <index referenceId="SALES_SHIPMENT_EMAIL_SENT" indexType="btree">
  760. <column name="email_sent"/>
  761. </index>
  762. </table>
  763. <table name="sales_shipment_grid" resource="sales" engine="innodb" comment="Sales Flat Shipment Grid">
  764. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="false"
  765. comment="Entity ID"/>
  766. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  767. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  768. comment="Store ID"/>
  769. <column xsi:type="varchar" name="order_increment_id" nullable="false" length="32" comment="Order Increment ID"/>
  770. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  771. comment="Order ID"/>
  772. <column xsi:type="timestamp" name="order_created_at" on_update="false" nullable="false"
  773. default="CURRENT_TIMESTAMP" comment="Order Increment ID"/>
  774. <column xsi:type="varchar" name="customer_name" nullable="false" length="128" comment="Customer Name"/>
  775. <column xsi:type="decimal" name="total_qty" scale="4" precision="12" unsigned="false" nullable="true"
  776. comment="Total Qty"/>
  777. <column xsi:type="int" name="shipment_status" unsigned="false" nullable="true" identity="false"
  778. comment="Shipment Status"/>
  779. <column xsi:type="varchar" name="order_status" nullable="true" length="32" comment="Order"/>
  780. <column xsi:type="varchar" name="billing_address" nullable="true" length="255" comment="Billing Address"/>
  781. <column xsi:type="varchar" name="shipping_address" nullable="true" length="255" comment="Shipping Address"/>
  782. <column xsi:type="varchar" name="billing_name" nullable="true" length="128" comment="Billing Name"/>
  783. <column xsi:type="varchar" name="shipping_name" nullable="true" length="128" comment="Shipping Name"/>
  784. <column xsi:type="varchar" name="customer_email" nullable="true" length="128" comment="Customer Email"/>
  785. <column xsi:type="int" name="customer_group_id" unsigned="false" nullable="true" identity="false"/>
  786. <column xsi:type="varchar" name="payment_method" nullable="true" length="32" comment="Payment Method"/>
  787. <column xsi:type="varchar" name="shipping_information" nullable="true" length="255"
  788. comment="Shipping Method Name"/>
  789. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created At"/>
  790. <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated At"/>
  791. <constraint xsi:type="primary" referenceId="PRIMARY">
  792. <column name="entity_id"/>
  793. </constraint>
  794. <constraint xsi:type="unique" referenceId="SALES_SHIPMENT_GRID_INCREMENT_ID_STORE_ID">
  795. <column name="increment_id"/>
  796. <column name="store_id"/>
  797. </constraint>
  798. <index referenceId="SALES_SHIPMENT_GRID_STORE_ID" indexType="btree">
  799. <column name="store_id"/>
  800. </index>
  801. <index referenceId="SALES_SHIPMENT_GRID_TOTAL_QTY" indexType="btree">
  802. <column name="total_qty"/>
  803. </index>
  804. <index referenceId="SALES_SHIPMENT_GRID_ORDER_INCREMENT_ID" indexType="btree">
  805. <column name="order_increment_id"/>
  806. </index>
  807. <index referenceId="SALES_SHIPMENT_GRID_SHIPMENT_STATUS" indexType="btree">
  808. <column name="shipment_status"/>
  809. </index>
  810. <index referenceId="SALES_SHIPMENT_GRID_ORDER_STATUS" indexType="btree">
  811. <column name="order_status"/>
  812. </index>
  813. <index referenceId="SALES_SHIPMENT_GRID_CREATED_AT" indexType="btree">
  814. <column name="created_at"/>
  815. </index>
  816. <index referenceId="SALES_SHIPMENT_GRID_UPDATED_AT" indexType="btree">
  817. <column name="updated_at"/>
  818. </index>
  819. <index referenceId="SALES_SHIPMENT_GRID_ORDER_CREATED_AT" indexType="btree">
  820. <column name="order_created_at"/>
  821. </index>
  822. <index referenceId="SALES_SHIPMENT_GRID_SHIPPING_NAME" indexType="btree">
  823. <column name="shipping_name"/>
  824. </index>
  825. <index referenceId="SALES_SHIPMENT_GRID_BILLING_NAME" indexType="btree">
  826. <column name="billing_name"/>
  827. </index>
  828. <index referenceId="SALES_SHIPMENT_GRID_ORDER_ID" indexType="btree">
  829. <column name="order_id"/>
  830. </index>
  831. <index referenceId="FTI_086B40C8955F167B8EA76653437879B4" indexType="fulltext">
  832. <column name="increment_id"/>
  833. <column name="order_increment_id"/>
  834. <column name="shipping_name"/>
  835. <column name="customer_name"/>
  836. <column name="customer_email"/>
  837. <column name="billing_address"/>
  838. <column name="shipping_address"/>
  839. </index>
  840. </table>
  841. <table name="sales_shipment_item" resource="sales" engine="innodb" comment="Sales Flat Shipment Item">
  842. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  843. comment="Entity ID"/>
  844. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  845. comment="Parent ID"/>
  846. <column xsi:type="decimal" name="row_total" scale="4" precision="20" unsigned="false" nullable="true"
  847. comment="Row Total"/>
  848. <column xsi:type="decimal" name="price" scale="4" precision="20" unsigned="false" nullable="true"
  849. comment="Price"/>
  850. <column xsi:type="decimal" name="weight" scale="4" precision="12" unsigned="false" nullable="true"
  851. comment="Weight"/>
  852. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="true" comment="Qty"/>
  853. <column xsi:type="int" name="product_id" unsigned="false" nullable="true" identity="false"
  854. comment="Product ID"/>
  855. <column xsi:type="int" name="order_item_id" unsigned="false" nullable="true" identity="false"
  856. comment="Order Item ID"/>
  857. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  858. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  859. <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
  860. <column xsi:type="varchar" name="sku" nullable="true" length="255" comment="Sku"/>
  861. <constraint xsi:type="primary" referenceId="PRIMARY">
  862. <column name="entity_id"/>
  863. </constraint>
  864. <constraint xsi:type="foreign" referenceId="SALES_SHIPMENT_ITEM_PARENT_ID_SALES_SHIPMENT_ENTITY_ID"
  865. table="sales_shipment_item" column="parent_id" referenceTable="sales_shipment"
  866. referenceColumn="entity_id" onDelete="CASCADE"/>
  867. <index referenceId="SALES_SHIPMENT_ITEM_PARENT_ID" indexType="btree">
  868. <column name="parent_id"/>
  869. </index>
  870. </table>
  871. <table name="sales_shipment_track" resource="sales" engine="innodb" comment="Sales Flat Shipment Track">
  872. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  873. comment="Entity ID"/>
  874. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  875. comment="Parent ID"/>
  876. <column xsi:type="decimal" name="weight" scale="4" precision="12" unsigned="false" nullable="true"
  877. comment="Weight"/>
  878. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="true" comment="Qty"/>
  879. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  880. comment="Order ID"/>
  881. <column xsi:type="text" name="track_number" nullable="true" comment="Number"/>
  882. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  883. <column xsi:type="varchar" name="title" nullable="true" length="255" comment="Title"/>
  884. <column xsi:type="varchar" name="carrier_code" nullable="true" length="32" comment="Carrier Code"/>
  885. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  886. comment="Created At"/>
  887. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  888. comment="Updated At"/>
  889. <constraint xsi:type="primary" referenceId="PRIMARY">
  890. <column name="entity_id"/>
  891. </constraint>
  892. <constraint xsi:type="foreign" referenceId="SALES_SHIPMENT_TRACK_PARENT_ID_SALES_SHIPMENT_ENTITY_ID"
  893. table="sales_shipment_track" column="parent_id" referenceTable="sales_shipment"
  894. referenceColumn="entity_id" onDelete="CASCADE"/>
  895. <index referenceId="SALES_SHIPMENT_TRACK_PARENT_ID" indexType="btree">
  896. <column name="parent_id"/>
  897. </index>
  898. <index referenceId="SALES_SHIPMENT_TRACK_ORDER_ID" indexType="btree">
  899. <column name="order_id"/>
  900. </index>
  901. <index referenceId="SALES_SHIPMENT_TRACK_CREATED_AT" indexType="btree">
  902. <column name="created_at"/>
  903. </index>
  904. </table>
  905. <table name="sales_shipment_comment" resource="sales" engine="innodb" comment="Sales Flat Shipment Comment">
  906. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  907. comment="Entity ID"/>
  908. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  909. comment="Parent ID"/>
  910. <column xsi:type="int" name="is_customer_notified" unsigned="false" nullable="true"
  911. identity="false" comment="Is Customer Notified"/>
  912. <column xsi:type="smallint" name="is_visible_on_front" unsigned="true" nullable="false"
  913. identity="false" default="0" comment="Is Visible On Front"/>
  914. <column xsi:type="text" name="comment" nullable="true" comment="Comment"/>
  915. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  916. comment="Created At"/>
  917. <constraint xsi:type="primary" referenceId="PRIMARY">
  918. <column name="entity_id"/>
  919. </constraint>
  920. <constraint xsi:type="foreign" referenceId="SALES_SHIPMENT_COMMENT_PARENT_ID_SALES_SHIPMENT_ENTITY_ID"
  921. table="sales_shipment_comment" column="parent_id" referenceTable="sales_shipment"
  922. referenceColumn="entity_id" onDelete="CASCADE"/>
  923. <index referenceId="SALES_SHIPMENT_COMMENT_CREATED_AT" indexType="btree">
  924. <column name="created_at"/>
  925. </index>
  926. <index referenceId="SALES_SHIPMENT_COMMENT_PARENT_ID" indexType="btree">
  927. <column name="parent_id"/>
  928. </index>
  929. </table>
  930. <table name="sales_invoice" resource="sales" engine="innodb" comment="Sales Flat Invoice">
  931. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  932. comment="Entity ID"/>
  933. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  934. comment="Store ID"/>
  935. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  936. comment="Base Grand Total"/>
  937. <column xsi:type="decimal" name="shipping_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  938. comment="Shipping Tax Amount"/>
  939. <column xsi:type="decimal" name="tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  940. comment="Tax Amount"/>
  941. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  942. comment="Base Tax Amount"/>
  943. <column xsi:type="decimal" name="store_to_order_rate" scale="4" precision="20" unsigned="false" nullable="true"
  944. comment="Store To Order Rate"/>
  945. <column xsi:type="decimal" name="base_shipping_tax_amount" scale="4" precision="20" unsigned="false"
  946. nullable="true" comment="Base Shipping Tax Amount"/>
  947. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="20" unsigned="false"
  948. nullable="true" comment="Base Discount Amount"/>
  949. <column xsi:type="decimal" name="base_to_order_rate" scale="4" precision="20" unsigned="false" nullable="true"
  950. comment="Base To Order Rate"/>
  951. <column xsi:type="decimal" name="grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  952. comment="Grand Total"/>
  953. <column xsi:type="decimal" name="shipping_amount" scale="4" precision="20" unsigned="false" nullable="true"
  954. comment="Shipping Amount"/>
  955. <column xsi:type="decimal" name="subtotal_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  956. comment="Subtotal Incl Tax"/>
  957. <column xsi:type="decimal" name="base_subtotal_incl_tax" scale="4" precision="20" unsigned="false"
  958. nullable="true" comment="Base Subtotal Incl Tax"/>
  959. <column xsi:type="decimal" name="store_to_base_rate" scale="4" precision="20" unsigned="false" nullable="true"
  960. comment="Store To Base Rate"/>
  961. <column xsi:type="decimal" name="base_shipping_amount" scale="4" precision="20" unsigned="false"
  962. nullable="true" comment="Base Shipping Amount"/>
  963. <column xsi:type="decimal" name="total_qty" scale="4" precision="12" unsigned="false" nullable="true"
  964. comment="Total Qty"/>
  965. <column xsi:type="decimal" name="base_to_global_rate" scale="4" precision="20" unsigned="false" nullable="true"
  966. comment="Base To Global Rate"/>
  967. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  968. comment="Subtotal"/>
  969. <column xsi:type="decimal" name="base_subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  970. comment="Base Subtotal"/>
  971. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="true"
  972. comment="Discount Amount"/>
  973. <column xsi:type="int" name="billing_address_id" unsigned="false" nullable="true" identity="false"
  974. comment="Billing Address ID"/>
  975. <column xsi:type="smallint" name="is_used_for_refund" unsigned="true" nullable="true"
  976. identity="false" comment="Is Used For Refund"/>
  977. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  978. comment="Order ID"/>
  979. <column xsi:type="smallint" name="email_sent" unsigned="true" nullable="true" identity="false"
  980. comment="Email Sent"/>
  981. <column xsi:type="smallint" name="send_email" unsigned="true" nullable="true" identity="false"
  982. comment="Send Email"/>
  983. <column xsi:type="smallint" name="can_void_flag" unsigned="true" nullable="true" identity="false"
  984. comment="Can Void Flag"/>
  985. <column xsi:type="int" name="state" unsigned="false" nullable="true" identity="false"
  986. comment="State"/>
  987. <column xsi:type="int" name="shipping_address_id" unsigned="false" nullable="true" identity="false"
  988. comment="Shipping Address ID"/>
  989. <column xsi:type="varchar" name="store_currency_code" nullable="true" length="3" comment="Store Currency Code"/>
  990. <column xsi:type="varchar" name="transaction_id" nullable="true" length="255" comment="Transaction ID"/>
  991. <column xsi:type="varchar" name="order_currency_code" nullable="true" length="3" comment="Order Currency Code"/>
  992. <column xsi:type="varchar" name="base_currency_code" nullable="true" length="3" comment="Base Currency Code"/>
  993. <column xsi:type="varchar" name="global_currency_code" nullable="true" length="3"
  994. comment="Global Currency Code"/>
  995. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  996. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  997. comment="Created At"/>
  998. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  999. comment="Updated At"/>
  1000. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="20" unsigned="false"
  1001. nullable="true" comment="Discount Tax Compensation Amount"/>
  1002. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="20"
  1003. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  1004. <column xsi:type="decimal" name="shipping_discount_tax_compensation_amount" scale="4" precision="20"
  1005. unsigned="false" nullable="true" comment="Shipping Discount Tax Compensation Amount"/>
  1006. <column xsi:type="decimal" name="base_shipping_discount_tax_compensation_amnt" scale="4" precision="20"
  1007. unsigned="false" nullable="true" comment="Base Shipping Discount Tax Compensation Amount"/>
  1008. <column xsi:type="decimal" name="shipping_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  1009. comment="Shipping Incl Tax"/>
  1010. <column xsi:type="decimal" name="base_shipping_incl_tax" scale="4" precision="20" unsigned="false"
  1011. nullable="true" comment="Base Shipping Incl Tax"/>
  1012. <column xsi:type="decimal" name="base_total_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  1013. comment="Base Total Refunded"/>
  1014. <column xsi:type="varchar" name="discount_description" nullable="true" length="255"
  1015. comment="Discount Description"/>
  1016. <column xsi:type="text" name="customer_note" nullable="true" comment="Customer Note"/>
  1017. <column xsi:type="smallint" name="customer_note_notify" unsigned="true" nullable="true"
  1018. identity="false" comment="Customer Note Notify"/>
  1019. <constraint xsi:type="primary" referenceId="PRIMARY">
  1020. <column name="entity_id"/>
  1021. </constraint>
  1022. <constraint xsi:type="foreign" referenceId="SALES_INVOICE_ORDER_ID_SALES_ORDER_ENTITY_ID" table="sales_invoice"
  1023. column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="CASCADE"/>
  1024. <constraint xsi:type="foreign" referenceId="SALES_INVOICE_STORE_ID_STORE_STORE_ID" table="sales_invoice"
  1025. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  1026. <constraint xsi:type="unique" referenceId="SALES_INVOICE_INCREMENT_ID_STORE_ID">
  1027. <column name="increment_id"/>
  1028. <column name="store_id"/>
  1029. </constraint>
  1030. <index referenceId="SALES_INVOICE_STORE_ID" indexType="btree">
  1031. <column name="store_id"/>
  1032. </index>
  1033. <index referenceId="SALES_INVOICE_GRAND_TOTAL" indexType="btree">
  1034. <column name="grand_total"/>
  1035. </index>
  1036. <index referenceId="SALES_INVOICE_ORDER_ID" indexType="btree">
  1037. <column name="order_id"/>
  1038. </index>
  1039. <index referenceId="SALES_INVOICE_STATE" indexType="btree">
  1040. <column name="state"/>
  1041. </index>
  1042. <index referenceId="SALES_INVOICE_CREATED_AT" indexType="btree">
  1043. <column name="created_at"/>
  1044. </index>
  1045. <index referenceId="SALES_INVOICE_UPDATED_AT" indexType="btree">
  1046. <column name="updated_at"/>
  1047. </index>
  1048. <index referenceId="SALES_INVOICE_SEND_EMAIL" indexType="btree">
  1049. <column name="send_email"/>
  1050. </index>
  1051. <index referenceId="SALES_INVOICE_EMAIL_SENT" indexType="btree">
  1052. <column name="email_sent"/>
  1053. </index>
  1054. </table>
  1055. <table name="sales_invoice_grid" resource="sales" engine="innodb" comment="Sales Flat Invoice Grid">
  1056. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="false"
  1057. comment="Entity ID"/>
  1058. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  1059. <column xsi:type="int" name="state" unsigned="false" nullable="true" identity="false"
  1060. comment="State"/>
  1061. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1062. comment="Store ID"/>
  1063. <column xsi:type="varchar" name="store_name" nullable="true" length="255" comment="Store Name"/>
  1064. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  1065. comment="Order ID"/>
  1066. <column xsi:type="varchar" name="order_increment_id" nullable="true" length="50" comment="Order Increment ID"/>
  1067. <column xsi:type="timestamp" name="order_created_at" on_update="false" nullable="true"
  1068. comment="Order Created At"/>
  1069. <column xsi:type="varchar" name="customer_name" nullable="true" length="255" comment="Customer Name"/>
  1070. <column xsi:type="varchar" name="customer_email" nullable="true" length="255" comment="Customer Email"/>
  1071. <column xsi:type="int" name="customer_group_id" unsigned="false" nullable="true" identity="false"/>
  1072. <column xsi:type="varchar" name="payment_method" nullable="true" length="128" comment="Payment Method"/>
  1073. <column xsi:type="varchar" name="store_currency_code" nullable="true" length="3" comment="Store Currency Code"/>
  1074. <column xsi:type="varchar" name="order_currency_code" nullable="true" length="3" comment="Order Currency Code"/>
  1075. <column xsi:type="varchar" name="base_currency_code" nullable="true" length="3" comment="Base Currency Code"/>
  1076. <column xsi:type="varchar" name="global_currency_code" nullable="true" length="3"
  1077. comment="Global Currency Code"/>
  1078. <column xsi:type="varchar" name="billing_name" nullable="true" length="255" comment="Billing Name"/>
  1079. <column xsi:type="varchar" name="billing_address" nullable="true" length="255" comment="Billing Address"/>
  1080. <column xsi:type="varchar" name="shipping_address" nullable="true" length="255" comment="Shipping Address"/>
  1081. <column xsi:type="varchar" name="shipping_information" nullable="true" length="255"
  1082. comment="Shipping Method Name"/>
  1083. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  1084. comment="Subtotal"/>
  1085. <column xsi:type="decimal" name="shipping_and_handling" scale="4" precision="20" unsigned="false"
  1086. nullable="true" comment="Shipping and handling amount"/>
  1087. <column xsi:type="decimal" name="grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  1088. comment="Grand Total"/>
  1089. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created At"/>
  1090. <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated At"/>
  1091. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  1092. comment="Base Grand Total"/>
  1093. <constraint xsi:type="primary" referenceId="PRIMARY">
  1094. <column name="entity_id"/>
  1095. </constraint>
  1096. <constraint xsi:type="unique" referenceId="SALES_INVOICE_GRID_INCREMENT_ID_STORE_ID">
  1097. <column name="increment_id"/>
  1098. <column name="store_id"/>
  1099. </constraint>
  1100. <index referenceId="SALES_INVOICE_GRID_STORE_ID" indexType="btree">
  1101. <column name="store_id"/>
  1102. </index>
  1103. <index referenceId="SALES_INVOICE_GRID_GRAND_TOTAL" indexType="btree">
  1104. <column name="grand_total"/>
  1105. </index>
  1106. <index referenceId="SALES_INVOICE_GRID_ORDER_ID" indexType="btree">
  1107. <column name="order_id"/>
  1108. </index>
  1109. <index referenceId="SALES_INVOICE_GRID_STATE" indexType="btree">
  1110. <column name="state"/>
  1111. </index>
  1112. <index referenceId="SALES_INVOICE_GRID_ORDER_INCREMENT_ID" indexType="btree">
  1113. <column name="order_increment_id"/>
  1114. </index>
  1115. <index referenceId="SALES_INVOICE_GRID_CREATED_AT" indexType="btree">
  1116. <column name="created_at"/>
  1117. </index>
  1118. <index referenceId="SALES_INVOICE_GRID_UPDATED_AT" indexType="btree">
  1119. <column name="updated_at"/>
  1120. </index>
  1121. <index referenceId="SALES_INVOICE_GRID_ORDER_CREATED_AT" indexType="btree">
  1122. <column name="order_created_at"/>
  1123. </index>
  1124. <index referenceId="SALES_INVOICE_GRID_BILLING_NAME" indexType="btree">
  1125. <column name="billing_name"/>
  1126. </index>
  1127. <index referenceId="FTI_95D9C924DD6A8734EB8B5D01D60F90DE" indexType="fulltext">
  1128. <column name="increment_id"/>
  1129. <column name="order_increment_id"/>
  1130. <column name="billing_name"/>
  1131. <column name="billing_address"/>
  1132. <column name="shipping_address"/>
  1133. <column name="customer_name"/>
  1134. <column name="customer_email"/>
  1135. </index>
  1136. <index referenceId="SALES_INVOICE_GRID_BASE_GRAND_TOTAL" indexType="btree">
  1137. <column name="base_grand_total"/>
  1138. </index>
  1139. </table>
  1140. <table name="sales_invoice_item" resource="sales" engine="innodb" comment="Sales Flat Invoice Item">
  1141. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  1142. comment="Entity ID"/>
  1143. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  1144. comment="Parent ID"/>
  1145. <column xsi:type="decimal" name="base_price" scale="4" precision="12" unsigned="false" nullable="true"
  1146. comment="Base Price"/>
  1147. <column xsi:type="decimal" name="tax_amount" scale="4" precision="12" unsigned="false" nullable="true"
  1148. comment="Tax Amount"/>
  1149. <column xsi:type="decimal" name="base_row_total" scale="4" precision="20" unsigned="false" nullable="true"
  1150. comment="Base Row Total"/>
  1151. <column xsi:type="decimal" name="discount_amount" scale="4" precision="12" unsigned="false" nullable="true"
  1152. comment="Discount Amount"/>
  1153. <column xsi:type="decimal" name="row_total" scale="4" precision="20" unsigned="false" nullable="true"
  1154. comment="Row Total"/>
  1155. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="12" unsigned="false"
  1156. nullable="true" comment="Base Discount Amount"/>
  1157. <column xsi:type="decimal" name="price_incl_tax" scale="4" precision="12" unsigned="false" nullable="true"
  1158. comment="Price Incl Tax"/>
  1159. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="12" unsigned="false" nullable="true"
  1160. comment="Base Tax Amount"/>
  1161. <column xsi:type="decimal" name="base_price_incl_tax" scale="4" precision="12" unsigned="false" nullable="true"
  1162. comment="Base Price Incl Tax"/>
  1163. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="true" comment="Qty"/>
  1164. <column xsi:type="decimal" name="base_cost" scale="4" precision="12" unsigned="false" nullable="true"
  1165. comment="Base Cost"/>
  1166. <column xsi:type="decimal" name="price" scale="4" precision="12" unsigned="false" nullable="true"
  1167. comment="Price"/>
  1168. <column xsi:type="decimal" name="base_row_total_incl_tax" scale="4" precision="12" unsigned="false"
  1169. nullable="true" comment="Base Row Total Incl Tax"/>
  1170. <column xsi:type="decimal" name="row_total_incl_tax" scale="4" precision="12" unsigned="false" nullable="true"
  1171. comment="Row Total Incl Tax"/>
  1172. <column xsi:type="int" name="product_id" unsigned="false" nullable="true" identity="false"
  1173. comment="Product ID"/>
  1174. <column xsi:type="int" name="order_item_id" unsigned="false" nullable="true" identity="false"
  1175. comment="Order Item ID"/>
  1176. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  1177. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  1178. <column xsi:type="varchar" name="sku" nullable="true" length="255" comment="Sku"/>
  1179. <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
  1180. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="12" unsigned="false"
  1181. nullable="true" comment="Discount Tax Compensation Amount"/>
  1182. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="12"
  1183. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  1184. <column xsi:type="text" name="tax_ratio" nullable="true"
  1185. comment="Ratio of tax invoiced over tax of the order item"/>
  1186. <constraint xsi:type="primary" referenceId="PRIMARY">
  1187. <column name="entity_id"/>
  1188. </constraint>
  1189. <constraint xsi:type="foreign" referenceId="SALES_INVOICE_ITEM_PARENT_ID_SALES_INVOICE_ENTITY_ID"
  1190. table="sales_invoice_item" column="parent_id" referenceTable="sales_invoice"
  1191. referenceColumn="entity_id" onDelete="CASCADE"/>
  1192. <index referenceId="SALES_INVOICE_ITEM_PARENT_ID" indexType="btree">
  1193. <column name="parent_id"/>
  1194. </index>
  1195. </table>
  1196. <table name="sales_invoice_comment" resource="sales" engine="innodb" comment="Sales Flat Invoice Comment">
  1197. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  1198. comment="Entity ID"/>
  1199. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  1200. comment="Parent ID"/>
  1201. <column xsi:type="smallint" name="is_customer_notified" unsigned="true" nullable="true"
  1202. identity="false" comment="Is Customer Notified"/>
  1203. <column xsi:type="smallint" name="is_visible_on_front" unsigned="true" nullable="false"
  1204. identity="false" default="0" comment="Is Visible On Front"/>
  1205. <column xsi:type="text" name="comment" nullable="true" comment="Comment"/>
  1206. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  1207. comment="Created At"/>
  1208. <constraint xsi:type="primary" referenceId="PRIMARY">
  1209. <column name="entity_id"/>
  1210. </constraint>
  1211. <constraint xsi:type="foreign" referenceId="SALES_INVOICE_COMMENT_PARENT_ID_SALES_INVOICE_ENTITY_ID"
  1212. table="sales_invoice_comment" column="parent_id" referenceTable="sales_invoice"
  1213. referenceColumn="entity_id" onDelete="CASCADE"/>
  1214. <index referenceId="SALES_INVOICE_COMMENT_CREATED_AT" indexType="btree">
  1215. <column name="created_at"/>
  1216. </index>
  1217. <index referenceId="SALES_INVOICE_COMMENT_PARENT_ID" indexType="btree">
  1218. <column name="parent_id"/>
  1219. </index>
  1220. </table>
  1221. <table name="sales_creditmemo" resource="sales" engine="innodb" comment="Sales Flat Creditmemo">
  1222. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  1223. comment="Entity ID"/>
  1224. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1225. comment="Store ID"/>
  1226. <column xsi:type="decimal" name="adjustment_positive" scale="4" precision="20" unsigned="false" nullable="true"
  1227. comment="Adjustment Positive"/>
  1228. <column xsi:type="decimal" name="base_shipping_tax_amount" scale="4" precision="20" unsigned="false"
  1229. nullable="true" comment="Base Shipping Tax Amount"/>
  1230. <column xsi:type="decimal" name="store_to_order_rate" scale="4" precision="20" unsigned="false" nullable="true"
  1231. comment="Store To Order Rate"/>
  1232. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="20" unsigned="false"
  1233. nullable="true" comment="Base Discount Amount"/>
  1234. <column xsi:type="decimal" name="base_to_order_rate" scale="4" precision="20" unsigned="false" nullable="true"
  1235. comment="Base To Order Rate"/>
  1236. <column xsi:type="decimal" name="grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  1237. comment="Grand Total"/>
  1238. <column xsi:type="decimal" name="base_adjustment_negative" scale="4" precision="20" unsigned="false"
  1239. nullable="true" comment="Base Adjustment Negative"/>
  1240. <column xsi:type="decimal" name="base_subtotal_incl_tax" scale="4" precision="20" unsigned="false"
  1241. nullable="true" comment="Base Subtotal Incl Tax"/>
  1242. <column xsi:type="decimal" name="shipping_amount" scale="4" precision="20" unsigned="false" nullable="true"
  1243. comment="Shipping Amount"/>
  1244. <column xsi:type="decimal" name="subtotal_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  1245. comment="Subtotal Incl Tax"/>
  1246. <column xsi:type="decimal" name="adjustment_negative" scale="4" precision="20" unsigned="false" nullable="true"
  1247. comment="Adjustment Negative"/>
  1248. <column xsi:type="decimal" name="base_shipping_amount" scale="4" precision="20" unsigned="false"
  1249. nullable="true" comment="Base Shipping Amount"/>
  1250. <column xsi:type="decimal" name="store_to_base_rate" scale="4" precision="20" unsigned="false" nullable="true"
  1251. comment="Store To Base Rate"/>
  1252. <column xsi:type="decimal" name="base_to_global_rate" scale="4" precision="20" unsigned="false" nullable="true"
  1253. comment="Base To Global Rate"/>
  1254. <column xsi:type="decimal" name="base_adjustment" scale="4" precision="20" unsigned="false" nullable="true"
  1255. comment="Base Adjustment"/>
  1256. <column xsi:type="decimal" name="base_subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  1257. comment="Base Subtotal"/>
  1258. <column xsi:type="decimal" name="discount_amount" scale="4" precision="20" unsigned="false" nullable="true"
  1259. comment="Discount Amount"/>
  1260. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  1261. comment="Subtotal"/>
  1262. <column xsi:type="decimal" name="adjustment" scale="4" precision="20" unsigned="false" nullable="true"
  1263. comment="Adjustment"/>
  1264. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  1265. comment="Base Grand Total"/>
  1266. <column xsi:type="decimal" name="base_adjustment_positive" scale="4" precision="20" unsigned="false"
  1267. nullable="true" comment="Base Adjustment Positive"/>
  1268. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  1269. comment="Base Tax Amount"/>
  1270. <column xsi:type="decimal" name="shipping_tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  1271. comment="Shipping Tax Amount"/>
  1272. <column xsi:type="decimal" name="tax_amount" scale="4" precision="20" unsigned="false" nullable="true"
  1273. comment="Tax Amount"/>
  1274. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  1275. comment="Order ID"/>
  1276. <column xsi:type="smallint" name="email_sent" unsigned="true" nullable="true" identity="false"
  1277. comment="Email Sent"/>
  1278. <column xsi:type="smallint" name="send_email" unsigned="true" nullable="true" identity="false"
  1279. comment="Send Email"/>
  1280. <column xsi:type="int" name="creditmemo_status" unsigned="false" nullable="true" identity="false"
  1281. comment="Creditmemo Status"/>
  1282. <column xsi:type="int" name="state" unsigned="false" nullable="true" identity="false"
  1283. comment="State"/>
  1284. <column xsi:type="int" name="shipping_address_id" unsigned="false" nullable="true" identity="false"
  1285. comment="Shipping Address ID"/>
  1286. <column xsi:type="int" name="billing_address_id" unsigned="false" nullable="true" identity="false"
  1287. comment="Billing Address ID"/>
  1288. <column xsi:type="int" name="invoice_id" unsigned="false" nullable="true" identity="false"
  1289. comment="Invoice ID"/>
  1290. <column xsi:type="varchar" name="store_currency_code" nullable="true" length="3" comment="Store Currency Code"/>
  1291. <column xsi:type="varchar" name="order_currency_code" nullable="true" length="3" comment="Order Currency Code"/>
  1292. <column xsi:type="varchar" name="base_currency_code" nullable="true" length="3" comment="Base Currency Code"/>
  1293. <column xsi:type="varchar" name="global_currency_code" nullable="true" length="3"
  1294. comment="Global Currency Code"/>
  1295. <column xsi:type="varchar" name="transaction_id" nullable="true" length="255" comment="Transaction ID"/>
  1296. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  1297. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  1298. comment="Created At"/>
  1299. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  1300. comment="Updated At"/>
  1301. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="20" unsigned="false"
  1302. nullable="true" comment="Discount Tax Compensation Amount"/>
  1303. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="20"
  1304. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  1305. <column xsi:type="decimal" name="shipping_discount_tax_compensation_amount" scale="4" precision="20"
  1306. unsigned="false" nullable="true" comment="Shipping Discount Tax Compensation Amount"/>
  1307. <column xsi:type="decimal" name="base_shipping_discount_tax_compensation_amnt" scale="4" precision="20"
  1308. unsigned="false" nullable="true" comment="Base Shipping Discount Tax Compensation Amount"/>
  1309. <column xsi:type="decimal" name="shipping_incl_tax" scale="4" precision="20" unsigned="false" nullable="true"
  1310. comment="Shipping Incl Tax"/>
  1311. <column xsi:type="decimal" name="base_shipping_incl_tax" scale="4" precision="20" unsigned="false"
  1312. nullable="true" comment="Base Shipping Incl Tax"/>
  1313. <column xsi:type="varchar" name="discount_description" nullable="true" length="255"
  1314. comment="Discount Description"/>
  1315. <column xsi:type="text" name="customer_note" nullable="true" comment="Customer Note"/>
  1316. <column xsi:type="smallint" name="customer_note_notify" unsigned="true" nullable="true"
  1317. identity="false" comment="Customer Note Notify"/>
  1318. <constraint xsi:type="primary" referenceId="PRIMARY">
  1319. <column name="entity_id"/>
  1320. </constraint>
  1321. <constraint xsi:type="foreign" referenceId="SALES_CREDITMEMO_ORDER_ID_SALES_ORDER_ENTITY_ID" table="sales_creditmemo"
  1322. column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="CASCADE"/>
  1323. <constraint xsi:type="foreign" referenceId="SALES_CREDITMEMO_STORE_ID_STORE_STORE_ID" table="sales_creditmemo"
  1324. column="store_id" referenceTable="store" referenceColumn="store_id" onDelete="SET NULL"/>
  1325. <constraint xsi:type="unique" referenceId="SALES_CREDITMEMO_INCREMENT_ID_STORE_ID">
  1326. <column name="increment_id"/>
  1327. <column name="store_id"/>
  1328. </constraint>
  1329. <index referenceId="SALES_CREDITMEMO_STORE_ID" indexType="btree">
  1330. <column name="store_id"/>
  1331. </index>
  1332. <index referenceId="SALES_CREDITMEMO_ORDER_ID" indexType="btree">
  1333. <column name="order_id"/>
  1334. </index>
  1335. <index referenceId="SALES_CREDITMEMO_CREDITMEMO_STATUS" indexType="btree">
  1336. <column name="creditmemo_status"/>
  1337. </index>
  1338. <index referenceId="SALES_CREDITMEMO_STATE" indexType="btree">
  1339. <column name="state"/>
  1340. </index>
  1341. <index referenceId="SALES_CREDITMEMO_CREATED_AT" indexType="btree">
  1342. <column name="created_at"/>
  1343. </index>
  1344. <index referenceId="SALES_CREDITMEMO_UPDATED_AT" indexType="btree">
  1345. <column name="updated_at"/>
  1346. </index>
  1347. <index referenceId="SALES_CREDITMEMO_SEND_EMAIL" indexType="btree">
  1348. <column name="send_email"/>
  1349. </index>
  1350. <index referenceId="SALES_CREDITMEMO_EMAIL_SENT" indexType="btree">
  1351. <column name="email_sent"/>
  1352. </index>
  1353. </table>
  1354. <table name="sales_creditmemo_grid" resource="sales" engine="innodb" comment="Sales Flat Creditmemo Grid">
  1355. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="false"
  1356. comment="Entity ID"/>
  1357. <column xsi:type="varchar" name="increment_id" nullable="true" length="50" comment="Increment ID"/>
  1358. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created At"/>
  1359. <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated At"/>
  1360. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  1361. comment="Order ID"/>
  1362. <column xsi:type="varchar" name="order_increment_id" nullable="true" length="50" comment="Order Increment ID"/>
  1363. <column xsi:type="timestamp" name="order_created_at" on_update="false" nullable="true"
  1364. comment="Order Created At"/>
  1365. <column xsi:type="varchar" name="billing_name" nullable="true" length="255" comment="Billing Name"/>
  1366. <column xsi:type="int" name="state" unsigned="false" nullable="true" identity="false"
  1367. comment="Status"/>
  1368. <column xsi:type="decimal" name="base_grand_total" scale="4" precision="20" unsigned="false" nullable="true"
  1369. comment="Base Grand Total"/>
  1370. <column xsi:type="varchar" name="order_status" nullable="true" length="32" comment="Order Status"/>
  1371. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1372. comment="Store ID"/>
  1373. <column xsi:type="varchar" name="billing_address" nullable="true" length="255" comment="Billing Address"/>
  1374. <column xsi:type="varchar" name="shipping_address" nullable="true" length="255" comment="Shipping Address"/>
  1375. <column xsi:type="varchar" name="customer_name" nullable="false" length="128" comment="Customer Name"/>
  1376. <column xsi:type="varchar" name="customer_email" nullable="true" length="128" comment="Customer Email"/>
  1377. <column xsi:type="smallint" name="customer_group_id" unsigned="false" nullable="true"
  1378. identity="false" comment="Customer Group ID"/>
  1379. <column xsi:type="varchar" name="payment_method" nullable="true" length="32" comment="Payment Method"/>
  1380. <column xsi:type="varchar" name="shipping_information" nullable="true" length="255"
  1381. comment="Shipping Method Name"/>
  1382. <column xsi:type="decimal" name="subtotal" scale="4" precision="20" unsigned="false" nullable="true"
  1383. comment="Subtotal"/>
  1384. <column xsi:type="decimal" name="shipping_and_handling" scale="4" precision="20" unsigned="false"
  1385. nullable="true" comment="Shipping and handling amount"/>
  1386. <column xsi:type="decimal" name="adjustment_positive" scale="4" precision="20" unsigned="false" nullable="true"
  1387. comment="Adjustment Positive"/>
  1388. <column xsi:type="decimal" name="adjustment_negative" scale="4" precision="20" unsigned="false" nullable="true"
  1389. comment="Adjustment Negative"/>
  1390. <column xsi:type="decimal" name="order_base_grand_total" scale="4" precision="20" unsigned="false"
  1391. nullable="true" comment="Order Grand Total"/>
  1392. <constraint xsi:type="primary" referenceId="PRIMARY">
  1393. <column name="entity_id"/>
  1394. </constraint>
  1395. <constraint xsi:type="unique" referenceId="SALES_CREDITMEMO_GRID_INCREMENT_ID_STORE_ID">
  1396. <column name="increment_id"/>
  1397. <column name="store_id"/>
  1398. </constraint>
  1399. <index referenceId="SALES_CREDITMEMO_GRID_ORDER_INCREMENT_ID" indexType="btree">
  1400. <column name="order_increment_id"/>
  1401. </index>
  1402. <index referenceId="SALES_CREDITMEMO_GRID_CREATED_AT" indexType="btree">
  1403. <column name="created_at"/>
  1404. </index>
  1405. <index referenceId="SALES_CREDITMEMO_GRID_UPDATED_AT" indexType="btree">
  1406. <column name="updated_at"/>
  1407. </index>
  1408. <index referenceId="SALES_CREDITMEMO_GRID_ORDER_CREATED_AT" indexType="btree">
  1409. <column name="order_created_at"/>
  1410. </index>
  1411. <index referenceId="SALES_CREDITMEMO_GRID_STATE" indexType="btree">
  1412. <column name="state"/>
  1413. </index>
  1414. <index referenceId="SALES_CREDITMEMO_GRID_BILLING_NAME" indexType="btree">
  1415. <column name="billing_name"/>
  1416. </index>
  1417. <index referenceId="SALES_CREDITMEMO_GRID_ORDER_STATUS" indexType="btree">
  1418. <column name="order_status"/>
  1419. </index>
  1420. <index referenceId="SALES_CREDITMEMO_GRID_BASE_GRAND_TOTAL" indexType="btree">
  1421. <column name="base_grand_total"/>
  1422. </index>
  1423. <index referenceId="SALES_CREDITMEMO_GRID_STORE_ID" indexType="btree">
  1424. <column name="store_id"/>
  1425. </index>
  1426. <index referenceId="SALES_CREDITMEMO_GRID_ORDER_BASE_GRAND_TOTAL" indexType="btree">
  1427. <column name="order_base_grand_total"/>
  1428. </index>
  1429. <index referenceId="SALES_CREDITMEMO_GRID_ORDER_ID" indexType="btree">
  1430. <column name="order_id"/>
  1431. </index>
  1432. <index referenceId="FTI_32B7BA885941A8254EE84AE650ABDC86" indexType="fulltext">
  1433. <column name="increment_id"/>
  1434. <column name="order_increment_id"/>
  1435. <column name="billing_name"/>
  1436. <column name="billing_address"/>
  1437. <column name="shipping_address"/>
  1438. <column name="customer_name"/>
  1439. <column name="customer_email"/>
  1440. </index>
  1441. </table>
  1442. <table name="sales_creditmemo_item" resource="sales" engine="innodb" comment="Sales Flat Creditmemo Item">
  1443. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  1444. comment="Entity ID"/>
  1445. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  1446. comment="Parent ID"/>
  1447. <column xsi:type="decimal" name="base_price" scale="4" precision="12" unsigned="false" nullable="true"
  1448. comment="Base Price"/>
  1449. <column xsi:type="decimal" name="tax_amount" scale="4" precision="12" unsigned="false" nullable="true"
  1450. comment="Tax Amount"/>
  1451. <column xsi:type="decimal" name="base_row_total" scale="4" precision="12" unsigned="false" nullable="true"
  1452. comment="Base Row Total"/>
  1453. <column xsi:type="decimal" name="discount_amount" scale="4" precision="12" unsigned="false" nullable="true"
  1454. comment="Discount Amount"/>
  1455. <column xsi:type="decimal" name="row_total" scale="4" precision="12" unsigned="false" nullable="true"
  1456. comment="Row Total"/>
  1457. <column xsi:type="decimal" name="base_discount_amount" scale="4" precision="12" unsigned="false"
  1458. nullable="true" comment="Base Discount Amount"/>
  1459. <column xsi:type="decimal" name="price_incl_tax" scale="4" precision="12" unsigned="false" nullable="true"
  1460. comment="Price Incl Tax"/>
  1461. <column xsi:type="decimal" name="base_tax_amount" scale="4" precision="12" unsigned="false" nullable="true"
  1462. comment="Base Tax Amount"/>
  1463. <column xsi:type="decimal" name="base_price_incl_tax" scale="4" precision="12" unsigned="false" nullable="true"
  1464. comment="Base Price Incl Tax"/>
  1465. <column xsi:type="decimal" name="qty" scale="4" precision="12" unsigned="false" nullable="true" comment="Qty"/>
  1466. <column xsi:type="decimal" name="base_cost" scale="4" precision="12" unsigned="false" nullable="true"
  1467. comment="Base Cost"/>
  1468. <column xsi:type="decimal" name="price" scale="4" precision="12" unsigned="false" nullable="true"
  1469. comment="Price"/>
  1470. <column xsi:type="decimal" name="base_row_total_incl_tax" scale="4" precision="12" unsigned="false"
  1471. nullable="true" comment="Base Row Total Incl Tax"/>
  1472. <column xsi:type="decimal" name="row_total_incl_tax" scale="4" precision="12" unsigned="false" nullable="true"
  1473. comment="Row Total Incl Tax"/>
  1474. <column xsi:type="int" name="product_id" unsigned="false" nullable="true" identity="false"
  1475. comment="Product ID"/>
  1476. <column xsi:type="int" name="order_item_id" unsigned="false" nullable="true" identity="false"
  1477. comment="Order Item ID"/>
  1478. <column xsi:type="text" name="additional_data" nullable="true" comment="Additional Data"/>
  1479. <column xsi:type="text" name="description" nullable="true" comment="Description"/>
  1480. <column xsi:type="varchar" name="sku" nullable="true" length="255" comment="Sku"/>
  1481. <column xsi:type="varchar" name="name" nullable="true" length="255" comment="Name"/>
  1482. <column xsi:type="decimal" name="discount_tax_compensation_amount" scale="4" precision="12" unsigned="false"
  1483. nullable="true" comment="Discount Tax Compensation Amount"/>
  1484. <column xsi:type="decimal" name="base_discount_tax_compensation_amount" scale="4" precision="12"
  1485. unsigned="false" nullable="true" comment="Base Discount Tax Compensation Amount"/>
  1486. <column xsi:type="text" name="tax_ratio" nullable="true"
  1487. comment="Ratio of tax in the creditmemo item over tax of the order item"/>
  1488. <constraint xsi:type="primary" referenceId="PRIMARY">
  1489. <column name="entity_id"/>
  1490. </constraint>
  1491. <constraint xsi:type="foreign" referenceId="SALES_CREDITMEMO_ITEM_PARENT_ID_SALES_CREDITMEMO_ENTITY_ID"
  1492. table="sales_creditmemo_item" column="parent_id" referenceTable="sales_creditmemo"
  1493. referenceColumn="entity_id" onDelete="CASCADE"/>
  1494. <index referenceId="SALES_CREDITMEMO_ITEM_PARENT_ID" indexType="btree">
  1495. <column name="parent_id"/>
  1496. </index>
  1497. </table>
  1498. <table name="sales_creditmemo_comment" resource="sales" engine="innodb" comment="Sales Flat Creditmemo Comment">
  1499. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  1500. comment="Entity ID"/>
  1501. <column xsi:type="int" name="parent_id" unsigned="true" nullable="false" identity="false"
  1502. comment="Parent ID"/>
  1503. <column xsi:type="int" name="is_customer_notified" unsigned="false" nullable="true"
  1504. identity="false" comment="Is Customer Notified"/>
  1505. <column xsi:type="smallint" name="is_visible_on_front" unsigned="true" nullable="false"
  1506. identity="false" default="0" comment="Is Visible On Front"/>
  1507. <column xsi:type="text" name="comment" nullable="true" comment="Comment"/>
  1508. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  1509. comment="Created At"/>
  1510. <constraint xsi:type="primary" referenceId="PRIMARY">
  1511. <column name="entity_id"/>
  1512. </constraint>
  1513. <constraint xsi:type="foreign" referenceId="SALES_CREDITMEMO_COMMENT_PARENT_ID_SALES_CREDITMEMO_ENTITY_ID"
  1514. table="sales_creditmemo_comment" column="parent_id" referenceTable="sales_creditmemo"
  1515. referenceColumn="entity_id" onDelete="CASCADE"/>
  1516. <index referenceId="SALES_CREDITMEMO_COMMENT_CREATED_AT" indexType="btree">
  1517. <column name="created_at"/>
  1518. </index>
  1519. <index referenceId="SALES_CREDITMEMO_COMMENT_PARENT_ID" indexType="btree">
  1520. <column name="parent_id"/>
  1521. </index>
  1522. </table>
  1523. <table name="sales_invoiced_aggregated" resource="sales" engine="innodb" comment="Sales Invoiced Aggregated">
  1524. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1525. <column xsi:type="date" name="period" comment="Period"/>
  1526. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1527. comment="Store ID"/>
  1528. <column xsi:type="varchar" name="order_status" nullable="true" length="50" comment="Order Status"/>
  1529. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1530. default="0" comment="Orders Count"/>
  1531. <column xsi:type="decimal" name="orders_invoiced" scale="4" precision="12" unsigned="false" nullable="true"
  1532. comment="Orders Invoiced"/>
  1533. <column xsi:type="decimal" name="invoiced" scale="4" precision="12" unsigned="false" nullable="true"
  1534. comment="Invoiced"/>
  1535. <column xsi:type="decimal" name="invoiced_captured" scale="4" precision="12" unsigned="false" nullable="true"
  1536. comment="Invoiced Captured"/>
  1537. <column xsi:type="decimal" name="invoiced_not_captured" scale="4" precision="12" unsigned="false"
  1538. nullable="true" comment="Invoiced Not Captured"/>
  1539. <constraint xsi:type="primary" referenceId="PRIMARY">
  1540. <column name="id"/>
  1541. </constraint>
  1542. <constraint xsi:type="foreign" referenceId="SALES_INVOICED_AGGREGATED_STORE_ID_STORE_STORE_ID"
  1543. table="sales_invoiced_aggregated" column="store_id" referenceTable="store"
  1544. referenceColumn="store_id" onDelete="SET NULL"/>
  1545. <constraint xsi:type="unique" referenceId="SALES_INVOICED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS">
  1546. <column name="period"/>
  1547. <column name="store_id"/>
  1548. <column name="order_status"/>
  1549. </constraint>
  1550. <index referenceId="SALES_INVOICED_AGGREGATED_STORE_ID" indexType="btree">
  1551. <column name="store_id"/>
  1552. </index>
  1553. </table>
  1554. <table name="sales_invoiced_aggregated_order" resource="sales" engine="innodb"
  1555. comment="Sales Invoiced Aggregated Order">
  1556. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1557. <column xsi:type="date" name="period" comment="Period"/>
  1558. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1559. comment="Store ID"/>
  1560. <column xsi:type="varchar" name="order_status" nullable="false" length="50" comment="Order Status"/>
  1561. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1562. default="0" comment="Orders Count"/>
  1563. <column xsi:type="decimal" name="orders_invoiced" scale="4" precision="12" unsigned="false" nullable="true"
  1564. comment="Orders Invoiced"/>
  1565. <column xsi:type="decimal" name="invoiced" scale="4" precision="12" unsigned="false" nullable="true"
  1566. comment="Invoiced"/>
  1567. <column xsi:type="decimal" name="invoiced_captured" scale="4" precision="12" unsigned="false" nullable="true"
  1568. comment="Invoiced Captured"/>
  1569. <column xsi:type="decimal" name="invoiced_not_captured" scale="4" precision="12" unsigned="false"
  1570. nullable="true" comment="Invoiced Not Captured"/>
  1571. <constraint xsi:type="primary" referenceId="PRIMARY">
  1572. <column name="id"/>
  1573. </constraint>
  1574. <constraint xsi:type="foreign" referenceId="SALES_INVOICED_AGGREGATED_ORDER_STORE_ID_STORE_STORE_ID"
  1575. table="sales_invoiced_aggregated_order" column="store_id" referenceTable="store"
  1576. referenceColumn="store_id" onDelete="SET NULL"/>
  1577. <constraint xsi:type="unique" referenceId="SALES_INVOICED_AGGREGATED_ORDER_PERIOD_STORE_ID_ORDER_STATUS">
  1578. <column name="period"/>
  1579. <column name="store_id"/>
  1580. <column name="order_status"/>
  1581. </constraint>
  1582. <index referenceId="SALES_INVOICED_AGGREGATED_ORDER_STORE_ID" indexType="btree">
  1583. <column name="store_id"/>
  1584. </index>
  1585. </table>
  1586. <table name="sales_order_aggregated_created" resource="sales" engine="innodb"
  1587. comment="Sales Order Aggregated Created">
  1588. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1589. <column xsi:type="date" name="period" comment="Period"/>
  1590. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1591. comment="Store ID"/>
  1592. <column xsi:type="varchar" name="order_status" nullable="false" length="50" comment="Order Status"/>
  1593. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1594. default="0" comment="Orders Count"/>
  1595. <column xsi:type="decimal" name="total_qty_ordered" scale="4" precision="12" unsigned="false" nullable="false"
  1596. default="0" comment="Total Qty Ordered"/>
  1597. <column xsi:type="decimal" name="total_qty_invoiced" scale="4" precision="12" unsigned="false" nullable="false"
  1598. default="0" comment="Total Qty Invoiced"/>
  1599. <column xsi:type="decimal" name="total_income_amount" scale="4" precision="20" unsigned="false"
  1600. nullable="false" default="0" comment="Total Income Amount"/>
  1601. <column xsi:type="decimal" name="total_revenue_amount" scale="4" precision="20" unsigned="false"
  1602. nullable="false" default="0" comment="Total Revenue Amount"/>
  1603. <column xsi:type="decimal" name="total_profit_amount" scale="4" precision="20" unsigned="false"
  1604. nullable="false" default="0" comment="Total Profit Amount"/>
  1605. <column xsi:type="decimal" name="total_invoiced_amount" scale="4" precision="20" unsigned="false"
  1606. nullable="false" default="0" comment="Total Invoiced Amount"/>
  1607. <column xsi:type="decimal" name="total_canceled_amount" scale="4" precision="20" unsigned="false"
  1608. nullable="false" default="0" comment="Total Canceled Amount"/>
  1609. <column xsi:type="decimal" name="total_paid_amount" scale="4" precision="20" unsigned="false" nullable="false"
  1610. default="0" comment="Total Paid Amount"/>
  1611. <column xsi:type="decimal" name="total_refunded_amount" scale="4" precision="20" unsigned="false"
  1612. nullable="false" default="0" comment="Total Refunded Amount"/>
  1613. <column xsi:type="decimal" name="total_tax_amount" scale="4" precision="20" unsigned="false" nullable="false"
  1614. default="0" comment="Total Tax Amount"/>
  1615. <column xsi:type="decimal" name="total_tax_amount_actual" scale="4" precision="20" unsigned="false"
  1616. nullable="false" default="0" comment="Total Tax Amount Actual"/>
  1617. <column xsi:type="decimal" name="total_shipping_amount" scale="4" precision="20" unsigned="false"
  1618. nullable="false" default="0" comment="Total Shipping Amount"/>
  1619. <column xsi:type="decimal" name="total_shipping_amount_actual" scale="4" precision="20" unsigned="false"
  1620. nullable="false" default="0" comment="Total Shipping Amount Actual"/>
  1621. <column xsi:type="decimal" name="total_discount_amount" scale="4" precision="20" unsigned="false"
  1622. nullable="false" default="0" comment="Total Discount Amount"/>
  1623. <column xsi:type="decimal" name="total_discount_amount_actual" scale="4" precision="20" unsigned="false"
  1624. nullable="false" default="0" comment="Total Discount Amount Actual"/>
  1625. <constraint xsi:type="primary" referenceId="PRIMARY">
  1626. <column name="id"/>
  1627. </constraint>
  1628. <constraint xsi:type="foreign" referenceId="SALES_ORDER_AGGREGATED_CREATED_STORE_ID_STORE_STORE_ID"
  1629. table="sales_order_aggregated_created" column="store_id" referenceTable="store"
  1630. referenceColumn="store_id" onDelete="SET NULL"/>
  1631. <constraint xsi:type="unique" referenceId="SALES_ORDER_AGGREGATED_CREATED_PERIOD_STORE_ID_ORDER_STATUS">
  1632. <column name="period"/>
  1633. <column name="store_id"/>
  1634. <column name="order_status"/>
  1635. </constraint>
  1636. <index referenceId="SALES_ORDER_AGGREGATED_CREATED_STORE_ID" indexType="btree">
  1637. <column name="store_id"/>
  1638. </index>
  1639. </table>
  1640. <table name="sales_order_aggregated_updated" resource="sales" engine="innodb"
  1641. comment="Sales Order Aggregated Updated">
  1642. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1643. <column xsi:type="date" name="period" comment="Period"/>
  1644. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1645. comment="Store ID"/>
  1646. <column xsi:type="varchar" name="order_status" nullable="false" length="50" comment="Order Status"/>
  1647. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1648. default="0" comment="Orders Count"/>
  1649. <column xsi:type="decimal" name="total_qty_ordered" scale="4" precision="12" unsigned="false" nullable="false"
  1650. default="0" comment="Total Qty Ordered"/>
  1651. <column xsi:type="decimal" name="total_qty_invoiced" scale="4" precision="12" unsigned="false" nullable="false"
  1652. default="0" comment="Total Qty Invoiced"/>
  1653. <column xsi:type="decimal" name="total_income_amount" scale="4" precision="20" unsigned="false"
  1654. nullable="false" default="0" comment="Total Income Amount"/>
  1655. <column xsi:type="decimal" name="total_revenue_amount" scale="4" precision="20" unsigned="false"
  1656. nullable="false" default="0" comment="Total Revenue Amount"/>
  1657. <column xsi:type="decimal" name="total_profit_amount" scale="4" precision="20" unsigned="false"
  1658. nullable="false" default="0" comment="Total Profit Amount"/>
  1659. <column xsi:type="decimal" name="total_invoiced_amount" scale="4" precision="20" unsigned="false"
  1660. nullable="false" default="0" comment="Total Invoiced Amount"/>
  1661. <column xsi:type="decimal" name="total_canceled_amount" scale="4" precision="20" unsigned="false"
  1662. nullable="false" default="0" comment="Total Canceled Amount"/>
  1663. <column xsi:type="decimal" name="total_paid_amount" scale="4" precision="20" unsigned="false" nullable="false"
  1664. default="0" comment="Total Paid Amount"/>
  1665. <column xsi:type="decimal" name="total_refunded_amount" scale="4" precision="20" unsigned="false"
  1666. nullable="false" default="0" comment="Total Refunded Amount"/>
  1667. <column xsi:type="decimal" name="total_tax_amount" scale="4" precision="20" unsigned="false" nullable="false"
  1668. default="0" comment="Total Tax Amount"/>
  1669. <column xsi:type="decimal" name="total_tax_amount_actual" scale="4" precision="20" unsigned="false"
  1670. nullable="false" default="0" comment="Total Tax Amount Actual"/>
  1671. <column xsi:type="decimal" name="total_shipping_amount" scale="4" precision="20" unsigned="false"
  1672. nullable="false" default="0" comment="Total Shipping Amount"/>
  1673. <column xsi:type="decimal" name="total_shipping_amount_actual" scale="4" precision="20" unsigned="false"
  1674. nullable="false" default="0" comment="Total Shipping Amount Actual"/>
  1675. <column xsi:type="decimal" name="total_discount_amount" scale="4" precision="20" unsigned="false"
  1676. nullable="false" default="0" comment="Total Discount Amount"/>
  1677. <column xsi:type="decimal" name="total_discount_amount_actual" scale="4" precision="20" unsigned="false"
  1678. nullable="false" default="0" comment="Total Discount Amount Actual"/>
  1679. <constraint xsi:type="primary" referenceId="PRIMARY">
  1680. <column name="id"/>
  1681. </constraint>
  1682. <constraint xsi:type="foreign" referenceId="SALES_ORDER_AGGREGATED_UPDATED_STORE_ID_STORE_STORE_ID"
  1683. table="sales_order_aggregated_updated" column="store_id" referenceTable="store"
  1684. referenceColumn="store_id" onDelete="SET NULL"/>
  1685. <constraint xsi:type="unique" referenceId="SALES_ORDER_AGGREGATED_UPDATED_PERIOD_STORE_ID_ORDER_STATUS">
  1686. <column name="period"/>
  1687. <column name="store_id"/>
  1688. <column name="order_status"/>
  1689. </constraint>
  1690. <index referenceId="SALES_ORDER_AGGREGATED_UPDATED_STORE_ID" indexType="btree">
  1691. <column name="store_id"/>
  1692. </index>
  1693. </table>
  1694. <table name="sales_payment_transaction" resource="sales" engine="innodb" comment="Sales Payment Transaction">
  1695. <column xsi:type="int" name="transaction_id" unsigned="true" nullable="false" identity="true"
  1696. comment="Transaction ID"/>
  1697. <column xsi:type="int" name="parent_id" unsigned="true" nullable="true" identity="false"
  1698. comment="Parent ID"/>
  1699. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  1700. default="0" comment="Order ID"/>
  1701. <column xsi:type="int" name="payment_id" unsigned="true" nullable="false" identity="false"
  1702. default="0" comment="Payment ID"/>
  1703. <column xsi:type="varchar" name="txn_id" nullable="true" length="100" comment="Txn ID"/>
  1704. <column xsi:type="varchar" name="parent_txn_id" nullable="true" length="100" comment="Parent Txn ID"/>
  1705. <column xsi:type="varchar" name="txn_type" nullable="true" length="15" comment="Txn Type"/>
  1706. <column xsi:type="smallint" name="is_closed" unsigned="true" nullable="false" identity="false"
  1707. default="1" comment="Is Closed"/>
  1708. <column xsi:type="blob" name="additional_information" nullable="true" comment="Additional Information"/>
  1709. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  1710. comment="Created At"/>
  1711. <constraint xsi:type="primary" referenceId="PRIMARY">
  1712. <column name="transaction_id"/>
  1713. </constraint>
  1714. <constraint xsi:type="foreign" referenceId="SALES_PAYMENT_TRANSACTION_ORDER_ID_SALES_ORDER_ENTITY_ID"
  1715. table="sales_payment_transaction" column="order_id" referenceTable="sales_order"
  1716. referenceColumn="entity_id" onDelete="CASCADE"/>
  1717. <constraint xsi:type="foreign" referenceId="FK_B99FF1A06402D725EBDB0F3A7ECD47A2" table="sales_payment_transaction"
  1718. column="parent_id" referenceTable="sales_payment_transaction" referenceColumn="transaction_id"
  1719. onDelete="CASCADE"/>
  1720. <constraint xsi:type="foreign" referenceId="SALES_PAYMENT_TRANSACTION_PAYMENT_ID_SALES_ORDER_PAYMENT_ENTT_ID"
  1721. table="sales_payment_transaction" column="payment_id" referenceTable="sales_order_payment"
  1722. referenceColumn="entity_id" onDelete="CASCADE"/>
  1723. <constraint xsi:type="unique" referenceId="SALES_PAYMENT_TRANSACTION_ORDER_ID_PAYMENT_ID_TXN_ID">
  1724. <column name="order_id"/>
  1725. <column name="payment_id"/>
  1726. <column name="txn_id"/>
  1727. </constraint>
  1728. <index referenceId="SALES_PAYMENT_TRANSACTION_PARENT_ID" indexType="btree">
  1729. <column name="parent_id"/>
  1730. </index>
  1731. <index referenceId="SALES_PAYMENT_TRANSACTION_PAYMENT_ID" indexType="btree">
  1732. <column name="payment_id"/>
  1733. </index>
  1734. </table>
  1735. <table name="sales_refunded_aggregated" resource="sales" engine="innodb" comment="Sales Refunded Aggregated">
  1736. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1737. <column xsi:type="date" name="period" comment="Period"/>
  1738. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1739. comment="Store ID"/>
  1740. <column xsi:type="varchar" name="order_status" nullable="false" length="50" comment="Order Status"/>
  1741. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1742. default="0" comment="Orders Count"/>
  1743. <column xsi:type="decimal" name="refunded" scale="4" precision="20" unsigned="false" nullable="true"
  1744. comment="Refunded"/>
  1745. <column xsi:type="decimal" name="online_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  1746. comment="Online Refunded"/>
  1747. <column xsi:type="decimal" name="offline_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  1748. comment="Offline Refunded"/>
  1749. <constraint xsi:type="primary" referenceId="PRIMARY">
  1750. <column name="id"/>
  1751. </constraint>
  1752. <constraint xsi:type="foreign" referenceId="SALES_REFUNDED_AGGREGATED_STORE_ID_STORE_STORE_ID"
  1753. table="sales_refunded_aggregated" column="store_id" referenceTable="store"
  1754. referenceColumn="store_id" onDelete="SET NULL"/>
  1755. <constraint xsi:type="unique" referenceId="SALES_REFUNDED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS">
  1756. <column name="period"/>
  1757. <column name="store_id"/>
  1758. <column name="order_status"/>
  1759. </constraint>
  1760. <index referenceId="SALES_REFUNDED_AGGREGATED_STORE_ID" indexType="btree">
  1761. <column name="store_id"/>
  1762. </index>
  1763. </table>
  1764. <table name="sales_refunded_aggregated_order" resource="sales" engine="innodb"
  1765. comment="Sales Refunded Aggregated Order">
  1766. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1767. <column xsi:type="date" name="period" comment="Period"/>
  1768. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1769. comment="Store ID"/>
  1770. <column xsi:type="varchar" name="order_status" nullable="true" length="50" comment="Order Status"/>
  1771. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1772. default="0" comment="Orders Count"/>
  1773. <column xsi:type="decimal" name="refunded" scale="4" precision="20" unsigned="false" nullable="true"
  1774. comment="Refunded"/>
  1775. <column xsi:type="decimal" name="online_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  1776. comment="Online Refunded"/>
  1777. <column xsi:type="decimal" name="offline_refunded" scale="4" precision="20" unsigned="false" nullable="true"
  1778. comment="Offline Refunded"/>
  1779. <constraint xsi:type="primary" referenceId="PRIMARY">
  1780. <column name="id"/>
  1781. </constraint>
  1782. <constraint xsi:type="foreign" referenceId="SALES_REFUNDED_AGGREGATED_ORDER_STORE_ID_STORE_STORE_ID"
  1783. table="sales_refunded_aggregated_order" column="store_id" referenceTable="store"
  1784. referenceColumn="store_id" onDelete="SET NULL"/>
  1785. <constraint xsi:type="unique" referenceId="SALES_REFUNDED_AGGREGATED_ORDER_PERIOD_STORE_ID_ORDER_STATUS">
  1786. <column name="period"/>
  1787. <column name="store_id"/>
  1788. <column name="order_status"/>
  1789. </constraint>
  1790. <index referenceId="SALES_REFUNDED_AGGREGATED_ORDER_STORE_ID" indexType="btree">
  1791. <column name="store_id"/>
  1792. </index>
  1793. </table>
  1794. <table name="sales_shipping_aggregated" resource="sales" engine="innodb" comment="Sales Shipping Aggregated">
  1795. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1796. <column xsi:type="date" name="period" comment="Period"/>
  1797. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1798. comment="Store ID"/>
  1799. <column xsi:type="varchar" name="order_status" nullable="true" length="50" comment="Order Status"/>
  1800. <column xsi:type="varchar" name="shipping_description" nullable="true" length="255"
  1801. comment="Shipping Description"/>
  1802. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1803. default="0" comment="Orders Count"/>
  1804. <column xsi:type="decimal" name="total_shipping" scale="4" precision="20" unsigned="false" nullable="true"
  1805. comment="Total Shipping"/>
  1806. <column xsi:type="decimal" name="total_shipping_actual" scale="4" precision="20" unsigned="false"
  1807. nullable="true" comment="Total Shipping Actual"/>
  1808. <constraint xsi:type="primary" referenceId="PRIMARY">
  1809. <column name="id"/>
  1810. </constraint>
  1811. <constraint xsi:type="foreign" referenceId="SALES_SHIPPING_AGGREGATED_STORE_ID_STORE_STORE_ID"
  1812. table="sales_shipping_aggregated" column="store_id" referenceTable="store"
  1813. referenceColumn="store_id" onDelete="SET NULL"/>
  1814. <constraint xsi:type="unique" referenceId="SALES_SHPP_AGGRED_PERIOD_STORE_ID_ORDER_STS_SHPP_DESCRIPTION">
  1815. <column name="period"/>
  1816. <column name="store_id"/>
  1817. <column name="order_status"/>
  1818. <column name="shipping_description"/>
  1819. </constraint>
  1820. <index referenceId="SALES_SHIPPING_AGGREGATED_STORE_ID" indexType="btree">
  1821. <column name="store_id"/>
  1822. </index>
  1823. </table>
  1824. <table name="sales_shipping_aggregated_order" resource="sales" engine="innodb"
  1825. comment="Sales Shipping Aggregated Order">
  1826. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1827. <column xsi:type="date" name="period" comment="Period"/>
  1828. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1829. comment="Store ID"/>
  1830. <column xsi:type="varchar" name="order_status" nullable="true" length="50" comment="Order Status"/>
  1831. <column xsi:type="varchar" name="shipping_description" nullable="true" length="255"
  1832. comment="Shipping Description"/>
  1833. <column xsi:type="int" name="orders_count" unsigned="false" nullable="false" identity="false"
  1834. default="0" comment="Orders Count"/>
  1835. <column xsi:type="decimal" name="total_shipping" scale="4" precision="20" unsigned="false" nullable="true"
  1836. comment="Total Shipping"/>
  1837. <column xsi:type="decimal" name="total_shipping_actual" scale="4" precision="20" unsigned="false"
  1838. nullable="true" comment="Total Shipping Actual"/>
  1839. <constraint xsi:type="primary" referenceId="PRIMARY">
  1840. <column name="id"/>
  1841. </constraint>
  1842. <constraint xsi:type="foreign" referenceId="SALES_SHIPPING_AGGREGATED_ORDER_STORE_ID_STORE_STORE_ID"
  1843. table="sales_shipping_aggregated_order" column="store_id" referenceTable="store"
  1844. referenceColumn="store_id" onDelete="SET NULL"/>
  1845. <constraint xsi:type="unique" referenceId="UNQ_C05FAE47282EEA68654D0924E946761F">
  1846. <column name="period"/>
  1847. <column name="store_id"/>
  1848. <column name="order_status"/>
  1849. <column name="shipping_description"/>
  1850. </constraint>
  1851. <index referenceId="SALES_SHIPPING_AGGREGATED_ORDER_STORE_ID" indexType="btree">
  1852. <column name="store_id"/>
  1853. </index>
  1854. </table>
  1855. <table name="sales_bestsellers_aggregated_daily" resource="sales" engine="innodb"
  1856. comment="Sales Bestsellers Aggregated Daily">
  1857. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1858. <column xsi:type="date" name="period" comment="Period"/>
  1859. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1860. comment="Store ID"/>
  1861. <column xsi:type="int" name="product_id" unsigned="true" nullable="true" identity="false"
  1862. comment="Product ID"/>
  1863. <column xsi:type="varchar" name="product_name" nullable="true" length="255" comment="Product Name"/>
  1864. <column xsi:type="decimal" name="product_price" scale="4" precision="12" unsigned="false" nullable="false"
  1865. default="0" comment="Product Price"/>
  1866. <column xsi:type="decimal" name="qty_ordered" scale="4" precision="12" unsigned="false" nullable="false"
  1867. default="0" comment="Qty Ordered"/>
  1868. <column xsi:type="smallint" name="rating_pos" unsigned="true" nullable="false" identity="false"
  1869. default="0" comment="Rating Pos"/>
  1870. <constraint xsi:type="primary" referenceId="PRIMARY">
  1871. <column name="id"/>
  1872. </constraint>
  1873. <constraint xsi:type="foreign" referenceId="SALES_BESTSELLERS_AGGREGATED_DAILY_STORE_ID_STORE_STORE_ID"
  1874. table="sales_bestsellers_aggregated_daily" column="store_id" referenceTable="store"
  1875. referenceColumn="store_id" onDelete="CASCADE"/>
  1876. <constraint xsi:type="unique" referenceId="SALES_BESTSELLERS_AGGREGATED_DAILY_PERIOD_STORE_ID_PRODUCT_ID">
  1877. <column name="period"/>
  1878. <column name="store_id"/>
  1879. <column name="product_id"/>
  1880. </constraint>
  1881. <index referenceId="SALES_BESTSELLERS_AGGREGATED_DAILY_STORE_ID" indexType="btree">
  1882. <column name="store_id"/>
  1883. </index>
  1884. <index referenceId="SALES_BESTSELLERS_AGGREGATED_DAILY_PRODUCT_ID" indexType="btree">
  1885. <column name="product_id"/>
  1886. </index>
  1887. </table>
  1888. <table name="sales_bestsellers_aggregated_monthly" resource="sales" engine="innodb"
  1889. comment="Sales Bestsellers Aggregated Monthly">
  1890. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1891. <column xsi:type="date" name="period" comment="Period"/>
  1892. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1893. comment="Store ID"/>
  1894. <column xsi:type="int" name="product_id" unsigned="true" nullable="true" identity="false"
  1895. comment="Product ID"/>
  1896. <column xsi:type="varchar" name="product_name" nullable="true" length="255" comment="Product Name"/>
  1897. <column xsi:type="decimal" name="product_price" scale="4" precision="12" unsigned="false" nullable="false"
  1898. default="0" comment="Product Price"/>
  1899. <column xsi:type="decimal" name="qty_ordered" scale="4" precision="12" unsigned="false" nullable="false"
  1900. default="0" comment="Qty Ordered"/>
  1901. <column xsi:type="smallint" name="rating_pos" unsigned="true" nullable="false" identity="false"
  1902. default="0" comment="Rating Pos"/>
  1903. <constraint xsi:type="primary" referenceId="PRIMARY">
  1904. <column name="id"/>
  1905. </constraint>
  1906. <constraint xsi:type="foreign" referenceId="SALES_BESTSELLERS_AGGREGATED_MONTHLY_STORE_ID_STORE_STORE_ID"
  1907. table="sales_bestsellers_aggregated_monthly" column="store_id" referenceTable="store"
  1908. referenceColumn="store_id" onDelete="CASCADE"/>
  1909. <constraint xsi:type="unique" referenceId="SALES_BESTSELLERS_AGGREGATED_MONTHLY_PERIOD_STORE_ID_PRODUCT_ID">
  1910. <column name="period"/>
  1911. <column name="store_id"/>
  1912. <column name="product_id"/>
  1913. </constraint>
  1914. <index referenceId="SALES_BESTSELLERS_AGGREGATED_MONTHLY_STORE_ID" indexType="btree">
  1915. <column name="store_id"/>
  1916. </index>
  1917. <index referenceId="SALES_BESTSELLERS_AGGREGATED_MONTHLY_PRODUCT_ID" indexType="btree">
  1918. <column name="product_id"/>
  1919. </index>
  1920. </table>
  1921. <table name="sales_bestsellers_aggregated_yearly" resource="sales" engine="innodb"
  1922. comment="Sales Bestsellers Aggregated Yearly">
  1923. <column xsi:type="int" name="id" unsigned="true" nullable="false" identity="true" comment="ID"/>
  1924. <column xsi:type="date" name="period" comment="Period"/>
  1925. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="true" identity="false"
  1926. comment="Store ID"/>
  1927. <column xsi:type="int" name="product_id" unsigned="true" nullable="true" identity="false"
  1928. comment="Product ID"/>
  1929. <column xsi:type="varchar" name="product_name" nullable="true" length="255" comment="Product Name"/>
  1930. <column xsi:type="decimal" name="product_price" scale="4" precision="12" unsigned="false" nullable="false"
  1931. default="0" comment="Product Price"/>
  1932. <column xsi:type="decimal" name="qty_ordered" scale="4" precision="12" unsigned="false" nullable="false"
  1933. default="0" comment="Qty Ordered"/>
  1934. <column xsi:type="smallint" name="rating_pos" unsigned="true" nullable="false" identity="false"
  1935. default="0" comment="Rating Pos"/>
  1936. <constraint xsi:type="primary" referenceId="PRIMARY">
  1937. <column name="id"/>
  1938. </constraint>
  1939. <constraint xsi:type="foreign" referenceId="SALES_BESTSELLERS_AGGREGATED_YEARLY_STORE_ID_STORE_STORE_ID"
  1940. table="sales_bestsellers_aggregated_yearly" column="store_id" referenceTable="store"
  1941. referenceColumn="store_id" onDelete="CASCADE"/>
  1942. <constraint xsi:type="unique" referenceId="SALES_BESTSELLERS_AGGREGATED_YEARLY_PERIOD_STORE_ID_PRODUCT_ID">
  1943. <column name="period"/>
  1944. <column name="store_id"/>
  1945. <column name="product_id"/>
  1946. </constraint>
  1947. <index referenceId="SALES_BESTSELLERS_AGGREGATED_YEARLY_STORE_ID" indexType="btree">
  1948. <column name="store_id"/>
  1949. </index>
  1950. <index referenceId="SALES_BESTSELLERS_AGGREGATED_YEARLY_PRODUCT_ID" indexType="btree">
  1951. <column name="product_id"/>
  1952. </index>
  1953. </table>
  1954. <table name="sales_order_tax" resource="sales" engine="innodb" comment="Sales Order Tax Table">
  1955. <column xsi:type="int" name="tax_id" unsigned="true" nullable="false" identity="true"
  1956. comment="Tax ID"/>
  1957. <column xsi:type="int" name="order_id" unsigned="true" nullable="false" identity="false"
  1958. comment="Order ID"/>
  1959. <column xsi:type="varchar" name="code" nullable="true" length="255" comment="Code"/>
  1960. <column xsi:type="varchar" name="title" nullable="true" length="255" comment="Title"/>
  1961. <column xsi:type="decimal" name="percent" scale="4" precision="12" unsigned="false" nullable="true"
  1962. comment="Percent"/>
  1963. <column xsi:type="decimal" name="amount" scale="4" precision="20" unsigned="false" nullable="true"
  1964. comment="Amount"/>
  1965. <column xsi:type="int" name="priority" unsigned="false" nullable="false" identity="false"
  1966. comment="Priority"/>
  1967. <column xsi:type="int" name="position" unsigned="false" nullable="false" identity="false"
  1968. comment="Position"/>
  1969. <column xsi:type="decimal" name="base_amount" scale="4" precision="20" unsigned="false" nullable="true"
  1970. comment="Base Amount"/>
  1971. <column xsi:type="smallint" name="process" unsigned="false" nullable="false" identity="false"
  1972. comment="Process"/>
  1973. <column xsi:type="decimal" name="base_real_amount" scale="4" precision="20" unsigned="false" nullable="true"
  1974. comment="Base Real Amount"/>
  1975. <constraint xsi:type="primary" referenceId="PRIMARY">
  1976. <column name="tax_id"/>
  1977. </constraint>
  1978. <index referenceId="SALES_ORDER_TAX_ORDER_ID_PRIORITY_POSITION" indexType="btree">
  1979. <column name="order_id"/>
  1980. <column name="priority"/>
  1981. <column name="position"/>
  1982. </index>
  1983. </table>
  1984. <table name="sales_order_tax_item" resource="sales" engine="innodb" comment="Sales Order Tax Item">
  1985. <column xsi:type="int" name="tax_item_id" unsigned="true" nullable="false" identity="true"
  1986. comment="Tax Item ID"/>
  1987. <column xsi:type="int" name="tax_id" unsigned="true" nullable="false" identity="false"
  1988. comment="Tax ID"/>
  1989. <column xsi:type="int" name="item_id" unsigned="true" nullable="true" identity="false"
  1990. comment="Item ID"/>
  1991. <column xsi:type="decimal" name="tax_percent" scale="4" precision="12" unsigned="false" nullable="false"
  1992. comment="Real Tax Percent For Item"/>
  1993. <column xsi:type="decimal" name="amount" scale="4" precision="20" unsigned="false" nullable="false"
  1994. comment="Tax amount for the item and tax rate"/>
  1995. <column xsi:type="decimal" name="base_amount" scale="4" precision="20" unsigned="false" nullable="false"
  1996. comment="Base tax amount for the item and tax rate"/>
  1997. <column xsi:type="decimal" name="real_amount" scale="4" precision="20" unsigned="false" nullable="false"
  1998. comment="Real tax amount for the item and tax rate"/>
  1999. <column xsi:type="decimal" name="real_base_amount" scale="4" precision="20" unsigned="false" nullable="false"
  2000. comment="Real base tax amount for the item and tax rate"/>
  2001. <column xsi:type="int" name="associated_item_id" unsigned="true" nullable="true" identity="false"
  2002. comment="Id of the associated item"/>
  2003. <column xsi:type="varchar" name="taxable_item_type" nullable="false" length="32"
  2004. comment="Type of the taxable item"/>
  2005. <constraint xsi:type="primary" referenceId="PRIMARY">
  2006. <column name="tax_item_id"/>
  2007. </constraint>
  2008. <constraint xsi:type="foreign" referenceId="SALES_ORDER_TAX_ITEM_ASSOCIATED_ITEM_ID_SALES_ORDER_ITEM_ITEM_ID"
  2009. table="sales_order_tax_item" column="associated_item_id" referenceTable="sales_order_item"
  2010. referenceColumn="item_id" onDelete="CASCADE"/>
  2011. <constraint xsi:type="foreign" referenceId="SALES_ORDER_TAX_ITEM_TAX_ID_SALES_ORDER_TAX_TAX_ID"
  2012. table="sales_order_tax_item" column="tax_id" referenceTable="sales_order_tax"
  2013. referenceColumn="tax_id" onDelete="CASCADE"/>
  2014. <constraint xsi:type="foreign" referenceId="SALES_ORDER_TAX_ITEM_ITEM_ID_SALES_ORDER_ITEM_ITEM_ID"
  2015. table="sales_order_tax_item" column="item_id" referenceTable="sales_order_item"
  2016. referenceColumn="item_id" onDelete="CASCADE"/>
  2017. <constraint xsi:type="unique" referenceId="SALES_ORDER_TAX_ITEM_TAX_ID_ITEM_ID">
  2018. <column name="tax_id"/>
  2019. <column name="item_id"/>
  2020. </constraint>
  2021. <index referenceId="SALES_ORDER_TAX_ITEM_ITEM_ID" indexType="btree">
  2022. <column name="item_id"/>
  2023. </index>
  2024. </table>
  2025. <table name="sales_order_status" resource="sales" engine="innodb" comment="Sales Order Status Table">
  2026. <column xsi:type="varchar" name="status" nullable="false" length="32" comment="Status"/>
  2027. <column xsi:type="varchar" name="label" nullable="false" length="128" comment="Label"/>
  2028. <constraint xsi:type="primary" referenceId="PRIMARY">
  2029. <column name="status"/>
  2030. </constraint>
  2031. </table>
  2032. <table name="sales_order_status_state" resource="sales" engine="innodb" comment="Sales Order Status Table">
  2033. <column xsi:type="varchar" name="status" nullable="false" length="32" comment="Status"/>
  2034. <column xsi:type="varchar" name="state" nullable="false" length="32" comment="Label"/>
  2035. <column xsi:type="smallint" name="is_default" unsigned="true" nullable="false" identity="false"
  2036. default="0" comment="Is Default"/>
  2037. <column xsi:type="smallint" name="visible_on_front" unsigned="true" nullable="false"
  2038. identity="false" default="0" comment="Visible on front"/>
  2039. <constraint xsi:type="primary" referenceId="PRIMARY">
  2040. <column name="status"/>
  2041. <column name="state"/>
  2042. </constraint>
  2043. <constraint xsi:type="foreign" referenceId="SALES_ORDER_STATUS_STATE_STATUS_SALES_ORDER_STATUS_STATUS"
  2044. table="sales_order_status_state" column="status" referenceTable="sales_order_status"
  2045. referenceColumn="status" onDelete="CASCADE"/>
  2046. </table>
  2047. <table name="sales_order_status_label" resource="sales" engine="innodb" comment="Sales Order Status Label Table">
  2048. <column xsi:type="varchar" name="status" nullable="false" length="32" comment="Status"/>
  2049. <column xsi:type="smallint" name="store_id" unsigned="true" nullable="false" identity="false"
  2050. comment="Store ID"/>
  2051. <column xsi:type="varchar" name="label" nullable="false" length="128" comment="Label"/>
  2052. <constraint xsi:type="primary" referenceId="PRIMARY">
  2053. <column name="status"/>
  2054. <column name="store_id"/>
  2055. </constraint>
  2056. <constraint xsi:type="foreign" referenceId="SALES_ORDER_STATUS_LABEL_STATUS_SALES_ORDER_STATUS_STATUS"
  2057. table="sales_order_status_label" column="status" referenceTable="sales_order_status"
  2058. referenceColumn="status" onDelete="CASCADE"/>
  2059. <constraint xsi:type="foreign" referenceId="SALES_ORDER_STATUS_LABEL_STORE_ID_STORE_STORE_ID"
  2060. table="sales_order_status_label" column="store_id" referenceTable="store" referenceColumn="store_id"
  2061. onDelete="CASCADE"/>
  2062. <index referenceId="SALES_ORDER_STATUS_LABEL_STORE_ID" indexType="btree">
  2063. <column name="store_id"/>
  2064. </index>
  2065. </table>
  2066. </schema>