Overview
Theusers table manages user authentication and login credentials for the NominaSoft system. It stores basic user profile information including username, password, email, and name.
Table Definition
Column Reference
Unique identifier for each user (auto-incremented). Primary key.
User’s login username. Must be unique for authentication.
User’s password (should be hashed in application layer).
User’s email address for notifications and recovery.
User’s full name or display name.
Constraints
Primary Key
- uid: Auto-incrementing unique identifier
Not Null Constraints
- All columns are required (NOT NULL)
Usage Notes
The password field stores passwords. In production, ensure passwords are properly hashed using bcrypt, Argon2, or similar algorithms before storage.
Security Considerations
- Password Hashing: Always hash passwords before storing them
- Username Uniqueness: Implement unique constraint on username
- Email Validation: Validate email format in application layer
- Session Management: Implement secure session handling with uid
Example Queries
Insert New User
Authenticate User
List All Users
Update User Email
Related Tables
Theusers table is independent and does not have foreign key relationships with other tables in the payroll schema. It serves purely for authentication purposes.
Best Practices
- Store hashed passwords only (never plain text)
- Implement rate limiting for login attempts
- Add created_at and updated_at timestamps
- Consider adding role/permission fields for access control
- Implement account status (active/inactive/locked)