llx_user.sql 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. -- ============================================================================
  2. -- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. -- Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
  4. -- Copyright (C) 2007-2013 Regis Houssin <regis.houssin@inodbox.com>
  5. --
  6. -- This program is free software; you can redistribute it and/or modify
  7. -- it under the terms of the GNU General Public License as published by
  8. -- the Free Software Foundation; either version 3 of the License, or
  9. -- (at your option) any later version.
  10. --
  11. -- This program is distributed in the hope that it will be useful,
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. -- GNU General Public License for more details.
  15. --
  16. -- You should have received a copy of the GNU General Public License
  17. -- along with this program. If not, see <https://www.gnu.org/licenses/>.
  18. -- ===========================================================================
  19. create table llx_user
  20. (
  21. rowid integer AUTO_INCREMENT PRIMARY KEY,
  22. entity integer DEFAULT 1 NOT NULL, -- multi company id
  23. ref_employee varchar(50),
  24. ref_ext varchar(50), -- reference into an external system (not used by dolibarr)
  25. admin smallint DEFAULT 0, -- user has admin profile
  26. employee tinyint DEFAULT 1, -- 1 if user is an employee
  27. fk_establishment integer DEFAULT 0,
  28. datec datetime, -- date/time of creation
  29. tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  30. fk_user_creat integer, -- user who created dataset
  31. fk_user_modif integer, -- user who modified dataset
  32. login varchar(50) NOT NULL,
  33. pass_encoding varchar(24),
  34. pass varchar(128),
  35. pass_crypted varchar(128),
  36. pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validity)
  37. api_key varchar(128), -- key to use REST API by this user
  38. gender varchar(10),
  39. civility varchar(6),
  40. lastname varchar(50),
  41. firstname varchar(50),
  42. address varchar(255), -- user personal address
  43. zip varchar(25), -- zipcode
  44. town varchar(50), -- town
  45. fk_state integer DEFAULT 0,
  46. fk_country integer DEFAULT 0,
  47. birth date, -- birthday
  48. birth_place varchar(64), -- birth place (town)
  49. job varchar(128),
  50. office_phone varchar(20),
  51. office_fax varchar(20),
  52. user_mobile varchar(20),
  53. personal_mobile varchar(20),
  54. email varchar(255),
  55. personal_email varchar(255),
  56. signature text DEFAULT NULL,
  57. socialnetworks text DEFAULT NULL, -- json with socialnetworks
  58. --module_comm smallint DEFAULT 1,
  59. --module_compta smallint DEFAULT 1,
  60. fk_soc integer NULL, -- id thirdparty if user linked to a company (external user)
  61. fk_socpeople integer NULL, -- id contact origin if user linked to a contact
  62. fk_member integer NULL, -- if member if user linked to a member
  63. fk_user integer NULL, -- Supervisor, hierarchic parent
  64. fk_user_expense_validator integer NULL,
  65. fk_user_holiday_validator integer NULL,
  66. idpers1 varchar(128),
  67. idpers2 varchar(128),
  68. idpers3 varchar(128),
  69. note_public text,
  70. note_private text DEFAULT NULL,
  71. model_pdf varchar(255) DEFAULT NULL,
  72. datelastlogin datetime,
  73. datepreviouslogin datetime,
  74. datelastpassvalidation datetime, -- last date we change password or we made a disconnect all
  75. datestartvalidity datetime,
  76. dateendvalidity datetime,
  77. iplastlogin varchar(250),
  78. ippreviouslogin varchar(250),
  79. egroupware_id integer,
  80. ldap_sid varchar(255) DEFAULT NULL,
  81. openid varchar(255),
  82. statut tinyint DEFAULT 1,
  83. photo varchar(255), -- filename or url of photo
  84. lang varchar(6), -- default language for communication. Note that language selected by user as interface language is savec into llx_user_param.
  85. color varchar(6),
  86. barcode varchar(255) DEFAULT NULL,
  87. fk_barcode_type integer DEFAULT 0,
  88. accountancy_code varchar(32) NULL,
  89. nb_holiday integer DEFAULT 0,
  90. thm double(24,8),
  91. tjm double(24,8),
  92. salary double(24,8), -- denormalized value coming from llx_user_employment
  93. salaryextra double(24,8), -- denormalized value coming from llx_user_employment
  94. dateemployment date, -- denormalized value coming from llx_user_employment
  95. dateemploymentend date, -- denormalized value coming from llx_user_employment
  96. weeklyhours double(16,8), -- denormalized value coming from llx_user_employment
  97. import_key varchar(14), -- import key
  98. default_range integer,
  99. default_c_exp_tax_cat integer,
  100. national_registration_number varchar(50),
  101. fk_warehouse integer -- default warehouse of user
  102. )ENGINE=innodb;