Table office.users
The users table contains users accounts and their login information. It also contains a sys user account which does not have a password. The sys user account is a special account used by the MixERP workflow to perform routine tasks. The sys user cannot have a valid password or cannot be allowed to log in interactively.
# Column Name Nullable Data Type Max Length Description
1user_idinteger0The primary key of the table, which is also a serial field.
2role_idinteger0
3office_idinteger0
4user_namecharacter varying50
5full_namecharacter varying100
6can_change_passwordboolean0
7passwordtext0
8elevatedboolean0
9audit_user_idinteger0Contains the id of the user who last inserted or updated the corresponding row.
10audit_tstimestamp with time zone0Contains the date and timestamp of the last insert or update action.

Foreign Keys

# Column Name Key Name References
2 role_id users_role_id_fkey office.roles.role_id
3 office_id users_office_id_fkey office.offices.office_id
9 audit_user_id users_audit_user_id_fkey office.users.user_id

Indices

Index Name Owner Access Method Definition Description
users_pkey postgres btree user_id
users_user_name_uix postgres btree upper(user_name::text)

Check Constraints

Constraint Name Description
users_elevated_chk
CHECK (NOT office.is_admin(user_id) AND NOT elevated OR office.is_admin(user_id))

Default Values

# Column Name Default
1 user_id nextval('office.users_user_id_seq'::regclass)
6 can_change_password true
8 elevated false
10 audit_ts now()

Triggers

Trigger Name Targets On Event Timing Condition Order Orientation Description
office.hash_password office.hash_password INSERT AFTER 0 ROW
office.user_trigger office.user_trigger UPDATE AFTER 0 ROW
office.user_trigger office.user_trigger INSERT AFTER 0 ROW