db_schema.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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="admin_user_session" resource="default" engine="innodb" comment="Admin User sessions table">
  11. <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="Entity ID"/>
  13. <column xsi:type="varchar" name="session_id" nullable="false" length="128" comment="Session id value"/>
  14. <column xsi:type="int" name="user_id" padding="10" unsigned="true" nullable="true" identity="false"
  15. comment="Admin User ID"/>
  16. <column xsi:type="smallint" name="status" padding="5" unsigned="true" nullable="false" identity="false"
  17. default="1" comment="Current Session status"/>
  18. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  19. comment="Created Time"/>
  20. <column xsi:type="timestamp" name="updated_at" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  21. comment="Update Time"/>
  22. <column xsi:type="varchar" name="ip" nullable="false" length="15" onCreate="migrateDataFrom(ip)"
  23. comment="Remote user IP"/>
  24. <constraint xsi:type="primary" referenceId="PRIMARY">
  25. <column name="id"/>
  26. </constraint>
  27. <constraint xsi:type="foreign" referenceId="ADMIN_USER_SESSION_USER_ID_ADMIN_USER_USER_ID" table="admin_user_session"
  28. column="user_id" referenceTable="admin_user" referenceColumn="user_id" onDelete="CASCADE"/>
  29. <index referenceId="ADMIN_USER_SESSION_SESSION_ID" indexType="btree">
  30. <column name="session_id"/>
  31. </index>
  32. <index referenceId="ADMIN_USER_SESSION_USER_ID" indexType="btree">
  33. <column name="user_id"/>
  34. </index>
  35. </table>
  36. <table name="password_reset_request_event" resource="default" engine="innodb"
  37. comment="Password Reset Request Event under a security control">
  38. <column xsi:type="int" name="id" padding="10" unsigned="true" nullable="false" identity="true"
  39. comment="Entity ID"/>
  40. <column xsi:type="smallint" name="request_type" padding="5" unsigned="true" nullable="false" identity="false"
  41. comment="Type of the event under a security control"/>
  42. <column xsi:type="varchar" name="account_reference" nullable="true" length="255"
  43. comment="An identifier for existing account or another target"/>
  44. <column xsi:type="timestamp" name="created_at" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  45. comment="Timestamp when the event occurs"/>
  46. <column xsi:type="varchar" name="ip" nullable="false" length="15" onCreate="migrateDataFrom(ip)"
  47. comment="Remote user IP"/>
  48. <constraint xsi:type="primary" referenceId="PRIMARY">
  49. <column name="id"/>
  50. </constraint>
  51. <index referenceId="PASSWORD_RESET_REQUEST_EVENT_ACCOUNT_REFERENCE" indexType="btree">
  52. <column name="account_reference"/>
  53. </index>
  54. <index referenceId="PASSWORD_RESET_REQUEST_EVENT_CREATED_AT" indexType="btree">
  55. <column name="created_at"/>
  56. </index>
  57. </table>
  58. </schema>