jobs
Table: jobs
The jobs table stores ZD file upload tasks within the system.
It tracks the status, execution times, and results of jobs assigned to users.
Columns
| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| id | int(11) | NOT NULL, AUTO_INCREMENT, PRIMARY KEY, UNIQUE | Unique identifier for each job |
| type | varchar(50) | NULL | Type or category of the job |
| status | enum('PENDING','DISPATCHED','DISPATCH_FAILED','STARTED','IN_PROGRESS','COMPLETED','FAILED') | NOT NULL | Current status of the job |
| mappedId | int(11) | NOT NULL | ID of the user assigned to the job (references user.mappedId) |
| data | text | NULL | Job-specific data or payload |
| created_at | datetime | DEFAULT CURRENT_TIMESTAMP | Timestamp when the job was created |
| modified_at | datetime | DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP | Timestamp when the job was last updated |
| started_at | datetime | NULL | Timestamp when the job execution started |
| completed_at | datetime | NULL | Timestamp when the job execution completed |
| result | text | NULL | Result or output produced by the job |
| comments | text | NULL | Additional comments or notes about the job |
Indexes
- PRIMARY - Primary key on
id - UNIQUE - Unique constraint on
id(job_id_UNIQUE) - fk_jobs_mappedId_idx - Index on
mappedId
Foreign Key Relations
fk_jobs_mappedId→user.mappedId- Links each job to the user responsible or assigned for execution
Usage Notes
- Tracks scheduled or on-demand tasks, their execution status, and outcomes.
statusenum allows monitoring job lifecycle from pending to completion or failure.dataandresultfields store job-specific information for processing or auditing.- Indexed by
mappedIdto quickly find all jobs assigned to a specific user.