db_schema.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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" resource="default" engine="innodb" comment="Admin User Table">
  11. <column xsi:type="int" name="user_id" padding="10" unsigned="true" nullable="false" identity="true"
  12. comment="User ID"/>
  13. <column xsi:type="varchar" name="firstname" nullable="true" length="32" comment="User First Name"/>
  14. <column xsi:type="varchar" name="lastname" nullable="true" length="32" comment="User Last Name"/>
  15. <column xsi:type="varchar" name="email" nullable="true" length="128" comment="User Email"/>
  16. <column xsi:type="varchar" name="username" nullable="true" length="40" comment="User Login"/>
  17. <column xsi:type="varchar" name="password" nullable="false" length="255" comment="User Password"/>
  18. <column xsi:type="timestamp" name="created" on_update="false" nullable="false" default="CURRENT_TIMESTAMP"
  19. comment="User Created Time"/>
  20. <column xsi:type="timestamp" name="modified" on_update="true" nullable="false" default="CURRENT_TIMESTAMP"
  21. comment="User Modified Time"/>
  22. <column xsi:type="timestamp" name="logdate" on_update="false" nullable="true" comment="User Last Login Time"/>
  23. <column xsi:type="smallint" name="lognum" padding="5" unsigned="true" nullable="false" identity="false"
  24. default="0" comment="User Login Number"/>
  25. <column xsi:type="smallint" name="reload_acl_flag" padding="6" unsigned="false" nullable="false"
  26. identity="false" default="0" comment="Reload ACL"/>
  27. <column xsi:type="smallint" name="is_active" padding="6" unsigned="false" nullable="false" identity="false"
  28. default="1" comment="User Is Active"/>
  29. <column xsi:type="text" name="extra" nullable="true" comment="User Extra Data"/>
  30. <column xsi:type="text" name="rp_token" nullable="true" comment="Reset Password Link Token"/>
  31. <column xsi:type="timestamp" name="rp_token_created_at" on_update="false" nullable="true"
  32. comment="Reset Password Link Token Creation Date"/>
  33. <column xsi:type="varchar" name="interface_locale" nullable="false" length="16" default="en_US"
  34. comment="Backend interface locale"/>
  35. <column xsi:type="smallint" name="failures_num" padding="6" unsigned="false" nullable="true" identity="false"
  36. default="0" comment="Failure Number"/>
  37. <column xsi:type="timestamp" name="first_failure" on_update="false" nullable="true" comment="First Failure"/>
  38. <column xsi:type="timestamp" name="lock_expires" on_update="false" nullable="true"
  39. comment="Expiration Lock Dates"/>
  40. <constraint xsi:type="primary" referenceId="PRIMARY">
  41. <column name="user_id"/>
  42. </constraint>
  43. <constraint xsi:type="unique" referenceId="ADMIN_USER_USERNAME">
  44. <column name="username"/>
  45. </constraint>
  46. </table>
  47. <table name="admin_passwords" resource="default" engine="innodb" comment="Admin Passwords">
  48. <column xsi:type="int" name="password_id" padding="10" unsigned="true" nullable="false" identity="true"
  49. comment="Password Id"/>
  50. <column xsi:type="int" name="user_id" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  51. comment="User Id"/>
  52. <column xsi:type="varchar" name="password_hash" nullable="true" length="100" comment="Password Hash"/>
  53. <column xsi:type="int" name="expires" padding="10" unsigned="true" nullable="false" identity="false" default="0"
  54. comment="Deprecated"/>
  55. <column xsi:type="int" name="last_updated" padding="10" unsigned="true" nullable="false" identity="false"
  56. default="0" comment="Last Updated"/>
  57. <constraint xsi:type="primary" referenceId="PRIMARY">
  58. <column name="password_id"/>
  59. </constraint>
  60. <constraint xsi:type="foreign" referenceId="ADMIN_PASSWORDS_USER_ID_ADMIN_USER_USER_ID" table="admin_passwords"
  61. column="user_id" referenceTable="admin_user" referenceColumn="user_id" onDelete="CASCADE"/>
  62. <index referenceId="ADMIN_PASSWORDS_USER_ID" indexType="btree">
  63. <column name="user_id"/>
  64. </index>
  65. </table>
  66. </schema>