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

153 строки
9.4 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="oauth_consumer" resource="default" engine="innodb" comment="OAuth Consumers">
  11. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  12. comment="Entity ID"/>
  13. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  14. comment="Created At"/>
  15. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="true" default="0"
  16. comment="Updated At"/>
  17. <column xsi:type="varchar" name="name" nullable="false" length="255" comment="Name of consumer"/>
  18. <column xsi:type="varchar" name="key" nullable="false" length="32" comment="Key code"/>
  19. <column xsi:type="varchar" name="secret" nullable="false" length="128" comment="Secret code"/>
  20. <column xsi:type="text" name="callback_url" nullable="true" comment="Callback URL"/>
  21. <column xsi:type="text" name="rejected_callback_url" nullable="false" comment="Rejected callback URL"/>
  22. <constraint xsi:type="primary" referenceId="PRIMARY">
  23. <column name="entity_id"/>
  24. </constraint>
  25. <constraint xsi:type="unique" referenceId="OAUTH_CONSUMER_KEY">
  26. <column name="key"/>
  27. </constraint>
  28. <constraint xsi:type="unique" referenceId="OAUTH_CONSUMER_SECRET">
  29. <column name="secret"/>
  30. </constraint>
  31. <index referenceId="OAUTH_CONSUMER_CREATED_AT" indexType="btree">
  32. <column name="created_at"/>
  33. </index>
  34. <index referenceId="OAUTH_CONSUMER_UPDATED_AT" indexType="btree">
  35. <column name="updated_at"/>
  36. </index>
  37. </table>
  38. <table name="oauth_token" resource="default" engine="innodb" comment="OAuth Tokens">
  39. <column xsi:type="int" name="entity_id" unsigned="true" nullable="false" identity="true"
  40. comment="Entity ID"/>
  41. <column xsi:type="int" name="consumer_id" unsigned="true" nullable="true" identity="false"
  42. comment="Oauth Consumer ID"/>
  43. <column xsi:type="int" name="admin_id" unsigned="true" nullable="true" identity="false"
  44. comment="Admin user ID"/>
  45. <column xsi:type="int" name="customer_id" unsigned="true" nullable="true" identity="false"
  46. comment="Customer user ID"/>
  47. <column xsi:type="varchar" name="type" nullable="false" length="16" comment="Token Type"/>
  48. <column xsi:type="varchar" name="token" nullable="false" length="32" comment="Token"/>
  49. <column xsi:type="varchar" name="secret" nullable="false" length="128" comment="Token Secret"/>
  50. <column xsi:type="varchar" name="verifier" nullable="true" length="32" comment="Token Verifier"/>
  51. <column xsi:type="text" name="callback_url" nullable="false" comment="Token Callback URL"/>
  52. <column xsi:type="smallint" name="revoked" unsigned="true" nullable="false" identity="false"
  53. default="0" comment="Is Token revoked"/>
  54. <column xsi:type="smallint" name="authorized" unsigned="true" nullable="false" identity="false"
  55. default="0" comment="Is Token authorized"/>
  56. <column xsi:type="int" name="user_type" unsigned="false" nullable="true" identity="false"
  57. comment="User type"/>
  58. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  59. comment="Token creation timestamp"/>
  60. <constraint xsi:type="primary" referenceId="PRIMARY">
  61. <column name="entity_id"/>
  62. </constraint>
  63. <constraint xsi:type="foreign" referenceId="OAUTH_TOKEN_ADMIN_ID_ADMIN_USER_USER_ID" table="oauth_token"
  64. column="admin_id" referenceTable="admin_user" referenceColumn="user_id" onDelete="CASCADE"/>
  65. <constraint xsi:type="foreign" referenceId="OAUTH_TOKEN_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID" table="oauth_token"
  66. column="consumer_id" referenceTable="oauth_consumer" referenceColumn="entity_id"
  67. onDelete="CASCADE"/>
  68. <constraint xsi:type="foreign" referenceId="OAUTH_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID" table="oauth_token"
  69. column="customer_id" referenceTable="customer_entity" referenceColumn="entity_id"
  70. onDelete="CASCADE"/>
  71. <constraint xsi:type="unique" referenceId="OAUTH_TOKEN_TOKEN">
  72. <column name="token"/>
  73. </constraint>
  74. <index referenceId="OAUTH_TOKEN_CONSUMER_ID" indexType="btree">
  75. <column name="consumer_id"/>
  76. </index>
  77. <index referenceId="OAUTH_TOKEN_CREATED_AT" indexType="btree">
  78. <column name="created_at"/>
  79. </index>
  80. </table>
  81. <table name="oauth_nonce" resource="default" engine="innodb" comment="OAuth Nonce">
  82. <column xsi:type="varchar" name="nonce" nullable="false" length="32" comment="Nonce String"/>
  83. <column xsi:type="int" name="timestamp" unsigned="true" nullable="false" identity="false"
  84. comment="Nonce Timestamp"/>
  85. <column xsi:type="int" name="consumer_id" unsigned="true" nullable="false" identity="false"
  86. comment="Consumer ID"/>
  87. <constraint xsi:type="foreign" referenceId="OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID" table="oauth_nonce"
  88. column="consumer_id" referenceTable="oauth_consumer" referenceColumn="entity_id"
  89. onDelete="CASCADE"/>
  90. <constraint xsi:type="primary" referenceId="OAUTH_NONCE_NONCE_CONSUMER_ID">
  91. <column name="nonce"/>
  92. <column name="consumer_id"/>
  93. </constraint>
  94. <index referenceId="OAUTH_NONCE_TIMESTAMP" indexType="btree">
  95. <column name="timestamp"/>
  96. </index>
  97. </table>
  98. <table name="integration" resource="default" engine="innodb" comment="integration">
  99. <column xsi:type="int" name="integration_id" unsigned="true" nullable="false" identity="true"
  100. comment="Integration ID"/>
  101. <column xsi:type="varchar" name="name" nullable="false" length="255"
  102. comment="Integration name is displayed in the admin interface"/>
  103. <column xsi:type="varchar" name="email" nullable="false" length="255"
  104. comment="Email address of the contact person"/>
  105. <column xsi:type="varchar" name="endpoint" nullable="true" length="255"
  106. comment="Endpoint for posting consumer credentials"/>
  107. <column xsi:type="smallint" name="status" unsigned="true" nullable="false" identity="false"
  108. comment="Integration status"/>
  109. <column xsi:type="int" name="consumer_id" unsigned="true" nullable="true" identity="false"
  110. comment="Oauth consumer"/>
  111. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  112. comment="Creation Time"/>
  113. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  114. comment="Update Time"/>
  115. <column xsi:type="smallint" name="setup_type" unsigned="true" nullable="false" identity="false"
  116. default="0" comment="Integration type - manual or config file"/>
  117. <column xsi:type="varchar" name="identity_link_url" nullable="true" length="255"
  118. comment="Identity linking Url"/>
  119. <constraint xsi:type="primary" referenceId="PRIMARY">
  120. <column name="integration_id"/>
  121. </constraint>
  122. <constraint xsi:type="foreign" referenceId="INTEGRATION_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID" table="integration"
  123. column="consumer_id" referenceTable="oauth_consumer" referenceColumn="entity_id"
  124. onDelete="CASCADE"/>
  125. <constraint xsi:type="unique" referenceId="INTEGRATION_NAME">
  126. <column name="name"/>
  127. </constraint>
  128. <constraint xsi:type="unique" referenceId="INTEGRATION_CONSUMER_ID">
  129. <column name="consumer_id"/>
  130. </constraint>
  131. </table>
  132. <table name="oauth_token_request_log" resource="default" engine="innodb"
  133. comment="Log of token request authentication failures.">
  134. <column xsi:type="int" name="log_id" unsigned="true" nullable="false" identity="true"
  135. comment="Log ID"/>
  136. <column xsi:type="varchar" name="user_name" nullable="false" length="255"
  137. comment="Customer email or admin login"/>
  138. <column xsi:type="smallint" name="user_type" unsigned="true" nullable="false" identity="false"
  139. comment="User type (admin or customer)"/>
  140. <column xsi:type="smallint" name="failures_count" unsigned="true" nullable="true" identity="false"
  141. default="0" comment="Number of failed authentication attempts in a row"/>
  142. <column xsi:type="timestamp" name="lock_expires_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  143. comment="Lock expiration time"/>
  144. <constraint xsi:type="primary" referenceId="PRIMARY">
  145. <column name="log_id"/>
  146. </constraint>
  147. <constraint xsi:type="unique" referenceId="OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE">
  148. <column name="user_name"/>
  149. <column name="user_type"/>
  150. </constraint>
  151. </table>
  152. </schema>