2002-04-29 22:57:25 +02:00
-- ============================================================================
2024-10-05 18:49:34 +02:00
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2007-2013 Regis Houssin <regis.houssin@inodbox.com>
-- Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
2002-04-29 22:57:25 +02:00
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
-- the Free Software Foundation; either version 3 of the License, or
2002-04-29 22:57:25 +02:00
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
2002-04-29 22:57:25 +02:00
-- ===========================================================================
create table llx_user
(
2022-08-24 21:49:33 +02:00
rowid integer AUTO_INCREMENT PRIMARY KEY ,
entity integer DEFAULT 1 NOT NULL , -- multi company id
2011-05-30 10:21:40 +02:00
2022-08-24 21:49:33 +02:00
ref_employee varchar ( 50 ) ,
ref_ext varchar ( 50 ) , -- reference into an external system (not used by dolibarr)
2019-09-11 22:27:09 +02:00
2022-08-24 21:49:33 +02:00
admin smallint DEFAULT 0 , -- user has admin profile
2020-11-18 15:56:06 +01:00
2022-08-24 21:49:33 +02:00
employee tinyint DEFAULT 1 , -- 1 if user is an employee
fk_establishment integer DEFAULT 0 ,
2011-05-30 10:21:40 +02:00
2022-08-24 21:49:33 +02:00
datec datetime , -- date/time of creation
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
fk_user_creat integer , -- user who created dataset
fk_user_modif integer , -- user who modified dataset
2024-12-03 12:12:22 +01:00
2022-08-24 21:49:33 +02:00
login varchar ( 50 ) NOT NULL ,
pass_encoding varchar ( 24 ) ,
pass varchar ( 128 ) ,
pass_crypted varchar ( 128 ) ,
2024-12-03 12:12:22 +01:00
pass_temp varchar ( 128 ) , -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validity)
api_key varchar ( 128 ) , -- key to use REST API by this user
2022-08-24 21:49:33 +02:00
gender varchar ( 10 ) ,
civility varchar ( 6 ) ,
lastname varchar ( 50 ) ,
firstname varchar ( 50 ) ,
2024-12-03 12:12:22 +01:00
address varchar ( 255 ) , -- user personal address
zip varchar ( 25 ) , -- zipcode
town varchar ( 50 ) , -- town
2022-08-24 21:49:33 +02:00
fk_state integer DEFAULT 0 ,
fk_country integer DEFAULT 0 ,
birth date , -- birthday
2022-11-02 02:19:26 +01:00
birth_place varchar ( 64 ) , -- birth place (town)
2022-08-24 21:49:33 +02:00
job varchar ( 128 ) ,
office_phone varchar ( 20 ) ,
office_fax varchar ( 20 ) ,
user_mobile varchar ( 20 ) ,
personal_mobile varchar ( 20 ) ,
email varchar ( 255 ) ,
personal_email varchar ( 255 ) ,
2024-04-22 14:50:25 +02:00
email_oauth2 varchar ( 255 ) , -- an email to validate OAuth2 authentication when email differs from the OAuth2 email
2024-11-29 14:47:15 +01:00
signature longtext DEFAULT NULL ,
2019-09-11 22:27:09 +02:00
2022-08-24 21:49:33 +02:00
socialnetworks text DEFAULT NULL , -- json with socialnetworks
2019-09-11 22:27:09 +02:00
2020-11-18 15:56:06 +01:00
- - module_comm smallint DEFAULT 1 ,
- - module_compta smallint DEFAULT 1 ,
2024-04-22 14:50:25 +02:00
2022-08-24 21:49:33 +02:00
fk_soc integer NULL , -- id thirdparty if user linked to a company (external user)
fk_socpeople integer NULL , -- id contact origin if user linked to a contact
fk_member integer NULL , -- if member if user linked to a member
fk_user integer NULL , -- Supervisor, hierarchic parent
fk_user_expense_validator integer NULL ,
fk_user_holiday_validator integer NULL ,
2024-04-22 14:50:25 +02:00
2024-12-03 12:12:22 +01:00
national_registration_number varchar ( 50 ) ,
2022-08-24 21:49:33 +02:00
idpers1 varchar ( 128 ) ,
idpers2 varchar ( 128 ) ,
idpers3 varchar ( 128 ) ,
2024-04-22 14:50:25 +02:00
2022-09-13 15:42:26 +02:00
note_public text ,
note_private text DEFAULT NULL ,
2022-08-24 21:49:33 +02:00
model_pdf varchar ( 255 ) DEFAULT NULL ,
2024-02-14 14:12:06 +01:00
last_main_doc varchar ( 255 ) , -- relative filepath+filename of last main generated document
2022-08-24 21:49:33 +02:00
datelastlogin datetime ,
datepreviouslogin datetime ,
datelastpassvalidation datetime , -- last date we change password or we made a disconnect all
datestartvalidity datetime ,
dateendvalidity datetime ,
2024-04-22 14:50:25 +02:00
flagdelsessionsbefore datetime DEFAULT NULL , -- set this to a date if we need to launch an external process to invalidate all sessions for the same login created before this date
2022-08-24 21:49:33 +02:00
iplastlogin varchar ( 250 ) ,
ippreviouslogin varchar ( 250 ) ,
ldap_sid varchar ( 255 ) DEFAULT NULL ,
openid varchar ( 255 ) ,
2024-12-03 12:12:22 +01:00
2022-08-24 21:49:33 +02:00
statut tinyint DEFAULT 1 ,
2024-12-03 12:12:22 +01:00
2022-08-24 21:49:33 +02:00
photo varchar ( 255 ) , -- filename or url of photo
2024-02-14 14:12:06 +01:00
lang varchar ( 6 ) , -- default language for communication. Note that language selected by user as interface language is savec into llx_user_param.
2022-08-24 21:49:33 +02:00
color varchar ( 6 ) ,
barcode varchar ( 255 ) DEFAULT NULL ,
fk_barcode_type integer DEFAULT 0 ,
2024-10-05 18:49:34 +02:00
accountancy_code_user_general varchar ( 32 ) DEFAULT NULL ,
accountancy_code varchar ( 32 ) NULL ,
2022-08-24 21:49:33 +02:00
nb_holiday integer DEFAULT 0 ,
thm double ( 24 , 8 ) ,
tjm double ( 24 , 8 ) ,
2016-09-28 19:49:36 +02:00
2024-09-26 23:16:08 +02:00
salary double ( 24 , 8 ) , -- DENORMALIZED FIELD. Value coming from llx_user_employment
salaryextra double ( 24 , 8 ) , -- DENORMALIZED FIELD. Value coming from llx_user_employment
dateemployment date , -- DENORMALIZED FIELD. Value coming from llx_user_employment
dateemploymentend date , -- DENORMALIZED FIELD. Value coming from llx_user_employment
weeklyhours double ( 16 , 8 ) , -- DENORMALIZED FIELD. Value coming from llx_user_employment
2017-04-17 04:22:53 +02:00
2022-08-24 21:49:33 +02:00
import_key varchar ( 14 ) , -- import key
2024-12-03 12:12:22 +01:00
2022-08-24 21:49:33 +02:00
default_range integer ,
default_c_exp_tax_cat integer ,
2024-12-03 12:12:22 +01:00
2022-08-24 21:49:33 +02:00
fk_warehouse integer -- default warehouse of user
2011-02-24 10:57:02 +01:00
) ENGINE = innodb ;