db_schema.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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="paypal_billing_agreement" resource="default" engine="innodb" comment="Sales Billing Agreement">
  11. <column xsi:type="int" name="agreement_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Agreement Id"/>
  13. <column xsi:type="int" name="customer_id" padding="10" unsigned="true" nullable="false" identity="false"
  14. comment="Customer Id"/>
  15. <column xsi:type="varchar" name="method_code" nullable="false" length="32" comment="Method Code"/>
  16. <column xsi:type="varchar" name="reference_id" nullable="false" length="32" comment="Reference Id"/>
  17. <column xsi:type="varchar" name="status" nullable="false" length="20" comment="Status"/>
  18. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  19. comment="Created At"/>
  20. <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated At"/>
  21. <column xsi:type="smallint" name="store_id" padding="5" unsigned="true" nullable="true" identity="false"
  22. comment="Store Id"/>
  23. <column xsi:type="varchar" name="agreement_label" nullable="true" length="255" comment="Agreement Label"/>
  24. <constraint xsi:type="primary" referenceId="PRIMARY">
  25. <column name="agreement_id"/>
  26. </constraint>
  27. <constraint xsi:type="foreign" referenceId="PAYPAL_BILLING_AGREEMENT_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID"
  28. table="paypal_billing_agreement" column="customer_id" referenceTable="customer_entity"
  29. referenceColumn="entity_id" onDelete="CASCADE"/>
  30. <constraint xsi:type="foreign" referenceId="PAYPAL_BILLING_AGREEMENT_STORE_ID_STORE_STORE_ID"
  31. table="paypal_billing_agreement" column="store_id" referenceTable="store" referenceColumn="store_id"
  32. onDelete="SET NULL"/>
  33. <index referenceId="PAYPAL_BILLING_AGREEMENT_CUSTOMER_ID" indexType="btree">
  34. <column name="customer_id"/>
  35. </index>
  36. <index referenceId="PAYPAL_BILLING_AGREEMENT_STORE_ID" indexType="btree">
  37. <column name="store_id"/>
  38. </index>
  39. </table>
  40. <table name="paypal_billing_agreement_order" resource="default" engine="innodb"
  41. comment="Sales Billing Agreement Order">
  42. <column xsi:type="int" name="agreement_id" padding="10" unsigned="true" nullable="false" identity="false"
  43. comment="Agreement Id"/>
  44. <column xsi:type="int" name="order_id" padding="10" unsigned="true" nullable="false" identity="false"
  45. comment="Order Id"/>
  46. <constraint xsi:type="primary" referenceId="PRIMARY">
  47. <column name="agreement_id"/>
  48. <column name="order_id"/>
  49. </constraint>
  50. <constraint xsi:type="foreign" referenceId="PAYPAL_BILLING_AGRT_ORDER_AGRT_ID_PAYPAL_BILLING_AGRT_AGRT_ID"
  51. table="paypal_billing_agreement_order" column="agreement_id"
  52. referenceTable="paypal_billing_agreement" referenceColumn="agreement_id" onDelete="CASCADE"/>
  53. <constraint xsi:type="foreign" referenceId="PAYPAL_BILLING_AGREEMENT_ORDER_ORDER_ID_SALES_ORDER_ENTITY_ID"
  54. table="paypal_billing_agreement_order" column="order_id" referenceTable="sales_order"
  55. referenceColumn="entity_id" onDelete="CASCADE"/>
  56. <index referenceId="PAYPAL_BILLING_AGREEMENT_ORDER_ORDER_ID" indexType="btree">
  57. <column name="order_id"/>
  58. </index>
  59. </table>
  60. <table name="paypal_settlement_report" resource="default" engine="innodb" comment="Paypal Settlement Report Table">
  61. <column xsi:type="int" name="report_id" padding="10" unsigned="true" nullable="false" identity="true"
  62. comment="Report Id"/>
  63. <column xsi:type="date" name="report_date" comment="Report Date"/>
  64. <column xsi:type="varchar" name="account_id" nullable="true" length="64" comment="Account Id"/>
  65. <column xsi:type="varchar" name="filename" nullable="true" length="24" comment="Filename"/>
  66. <column xsi:type="timestamp" name="last_modified" on_update="false" nullable="true" comment="Last Modified"/>
  67. <constraint xsi:type="primary" referenceId="PRIMARY">
  68. <column name="report_id"/>
  69. </constraint>
  70. <constraint xsi:type="unique" referenceId="PAYPAL_SETTLEMENT_REPORT_REPORT_DATE_ACCOUNT_ID">
  71. <column name="report_date"/>
  72. <column name="account_id"/>
  73. </constraint>
  74. </table>
  75. <table name="paypal_settlement_report_row" resource="default" engine="innodb"
  76. comment="Paypal Settlement Report Row Table">
  77. <column xsi:type="int" name="row_id" padding="10" unsigned="true" nullable="false" identity="true"
  78. comment="Row Id"/>
  79. <column xsi:type="int" name="report_id" padding="10" unsigned="true" nullable="false" identity="false"
  80. comment="Report Id"/>
  81. <column xsi:type="varchar" name="transaction_id" nullable="true" length="19" comment="Transaction Id"/>
  82. <column xsi:type="varchar" name="invoice_id" nullable="true" length="127" comment="Invoice Id"/>
  83. <column xsi:type="varchar" name="paypal_reference_id" nullable="true" length="19"
  84. comment="Paypal Reference Id"/>
  85. <column xsi:type="varchar" name="paypal_reference_id_type" nullable="true" length="3"
  86. comment="Paypal Reference Id Type"/>
  87. <column xsi:type="varchar" name="transaction_event_code" nullable="true" length="5"
  88. comment="Transaction Event Code"/>
  89. <column xsi:type="timestamp" name="transaction_initiation_date" on_update="false" nullable="true"
  90. comment="Transaction Initiation Date"/>
  91. <column xsi:type="timestamp" name="transaction_completion_date" on_update="false" nullable="true"
  92. comment="Transaction Completion Date"/>
  93. <column xsi:type="varchar" name="transaction_debit_or_credit" nullable="false" length="2" default="CR"
  94. comment="Transaction Debit Or Credit"/>
  95. <column xsi:type="decimal" name="gross_transaction_amount" scale="6" precision="20" unsigned="false"
  96. nullable="false" default="0" comment="Gross Transaction Amount"/>
  97. <column xsi:type="varchar" name="gross_transaction_currency" nullable="true" length="3"
  98. comment="Gross Transaction Currency"/>
  99. <column xsi:type="varchar" name="fee_debit_or_credit" nullable="true" length="2" comment="Fee Debit Or Credit"/>
  100. <column xsi:type="decimal" name="fee_amount" scale="6" precision="20" unsigned="false" nullable="false"
  101. default="0" comment="Fee Amount"/>
  102. <column xsi:type="varchar" name="fee_currency" nullable="true" length="3" comment="Fee Currency"/>
  103. <column xsi:type="varchar" name="custom_field" nullable="true" length="255" comment="Custom Field"/>
  104. <column xsi:type="varchar" name="consumer_id" nullable="true" length="127" comment="Consumer Id"/>
  105. <column xsi:type="varchar" name="payment_tracking_id" nullable="true" length="255"
  106. comment="Payment Tracking ID"/>
  107. <column xsi:type="varchar" name="store_id" nullable="true" length="50" comment="Store ID"/>
  108. <constraint xsi:type="primary" referenceId="PRIMARY">
  109. <column name="row_id"/>
  110. </constraint>
  111. <constraint xsi:type="foreign" referenceId="FK_E183E488F593E0DE10C6EBFFEBAC9B55" table="paypal_settlement_report_row"
  112. column="report_id" referenceTable="paypal_settlement_report" referenceColumn="report_id"
  113. onDelete="CASCADE"/>
  114. <index referenceId="PAYPAL_SETTLEMENT_REPORT_ROW_REPORT_ID" indexType="btree">
  115. <column name="report_id"/>
  116. </index>
  117. </table>
  118. <table name="paypal_cert" resource="default" engine="innodb" comment="Paypal Certificate Table">
  119. <column xsi:type="smallint" name="cert_id" padding="5" unsigned="true" nullable="false" identity="true"
  120. comment="Cert Id"/>
  121. <column xsi:type="smallint" name="website_id" padding="5" unsigned="true" nullable="false" identity="false"
  122. default="0" comment="Website Id"/>
  123. <column xsi:type="text" name="content" nullable="true" comment="Content"/>
  124. <column xsi:type="timestamp" name="updated_at" on_update="false" nullable="true" comment="Updated At"/>
  125. <constraint xsi:type="primary" referenceId="PRIMARY">
  126. <column name="cert_id"/>
  127. </constraint>
  128. <constraint xsi:type="foreign" referenceId="PAYPAL_CERT_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID" table="paypal_cert"
  129. column="website_id" referenceTable="store_website" referenceColumn="website_id" onDelete="CASCADE"/>
  130. <index referenceId="PAYPAL_CERT_WEBSITE_ID" indexType="btree">
  131. <column name="website_id"/>
  132. </index>
  133. </table>
  134. <table name="paypal_payment_transaction" resource="default" engine="innodb"
  135. comment="PayPal Payflow Link Payment Transaction">
  136. <column xsi:type="int" name="transaction_id" padding="10" unsigned="true" nullable="false" identity="true"
  137. comment="Entity ID"/>
  138. <column xsi:type="varchar" name="txn_id" nullable="true" length="100" comment="Txn Id"/>
  139. <column xsi:type="blob" name="additional_information" nullable="true" comment="Additional Information"/>
  140. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true" comment="Created At"/>
  141. <constraint xsi:type="primary" referenceId="PRIMARY">
  142. <column name="transaction_id"/>
  143. </constraint>
  144. <constraint xsi:type="unique" referenceId="PAYPAL_PAYMENT_TRANSACTION_TXN_ID">
  145. <column name="txn_id"/>
  146. </constraint>
  147. </table>
  148. <table name="quote_payment" resource="checkout" comment="Sales Flat Quote Payment">
  149. <column xsi:type="varchar" name="paypal_payer_id" nullable="true" length="255" comment="Paypal Payer Id"/>
  150. <column xsi:type="varchar" name="paypal_payer_status" nullable="true" length="255"
  151. comment="Paypal Payer Status"/>
  152. <column xsi:type="varchar" name="paypal_correlation_id" nullable="true" length="255"
  153. comment="Paypal Correlation Id"/>
  154. </table>
  155. <table name="sales_order" resource="sales" comment="Sales Flat Order">
  156. <column xsi:type="int" name="paypal_ipn_customer_notified" padding="11" unsigned="false" nullable="true"
  157. identity="false" default="0" comment="Paypal Ipn Customer Notified"/>
  158. </table>
  159. </schema>