@@ -29,6 +29,33 @@ Make sure you have a PostgreSQL database up and running. You’ll need to provid
29
29
30
30
Archer relies on a table structure to manage jobs. Ensure you have run the migration script (if provided), or set up your table accordingly.
31
31
32
+ ## How It Works
33
+
34
+ archer under the hood uses a table like the following.
35
+
36
+ ``` sql
37
+ CREATE TABLE jobs (
38
+ id varchar primary key ,
39
+ queue_name varchar not null ,
40
+ status varchar not null ,
41
+ arguments jsonb not null default ' {}' ::jsonb,
42
+ result jsonb not null default ' {}' ::jsonb,
43
+ last_error varchar ,
44
+ retry_count integer not null default 0 ,
45
+ max_retry integer not null default 0 ,
46
+ retry_interval integer not null default 0 ,
47
+ scheduled_at timestamptz default now(),
48
+ started_at timestamptz ,
49
+ created_at timestamptz not null default now(),
50
+ updated_at timestamptz not null default now()
51
+ );
52
+
53
+ CREATE INDEX ON jobs (queue_name);
54
+ CREATE INDEX ON jobs (scheduled_at);
55
+ CREATE INDEX ON jobs (status);
56
+ CREATE INDEX ON jobs (started_at);
57
+ ```
58
+
32
59
## Usage
33
60
34
61
### Importing the package
0 commit comments