Repository navigation
Expand file tree
/
Copy pathtaskflow-schema.sql
More file actions
125 lines (90 loc) · 3.11 KB
/
Copy pathtaskflow-schema.sql
File metadata and controls
125 lines (90 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
--
-- PostgreSQL database dump
--
\restrict GbFdh7xvfHZmqf4tt31BSiP3TcUslvGiPUJwEQQvwG8t3f3B6BkCRIlDjVb8AI2
-- Dumped from database version 18.4
-- Dumped by pg_dump version 18.4
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: job_executions; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.job_executions (
job_id uuid NOT NULL,
completed_at timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.job_executions OWNER TO postgres;
--
-- Name: jobs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.jobs (
id uuid DEFAULT gen_random_uuid() NOT NULL,
type text NOT NULL,
payload jsonb NOT NULL,
status text DEFAULT 'QUEUED'::text NOT NULL,
attempts integer DEFAULT 0 NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL,
locked_at timestamp without time zone,
worker_id text,
completed_at timestamp without time zone,
max_attempts integer DEFAULT 5 NOT NULL,
last_error text,
next_retry_at timestamp without time zone,
priority integer DEFAULT 5 NOT NULL,
idempotency_key text,
processing_started_at timestamp with time zone,
processing_duration_ms integer
);
ALTER TABLE public.jobs OWNER TO postgres;
--
-- Name: workers; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.workers (
id uuid DEFAULT gen_random_uuid() NOT NULL,
worker_id text NOT NULL,
status text DEFAULT 'ONLINE'::text NOT NULL,
current_job_id uuid,
last_seen timestamp with time zone DEFAULT now() NOT NULL,
started_at timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.workers OWNER TO postgres;
--
-- Name: job_executions job_executions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.job_executions
ADD CONSTRAINT job_executions_pkey PRIMARY KEY (job_id);
--
-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.jobs
ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
--
-- Name: workers workers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.workers
ADD CONSTRAINT workers_pkey PRIMARY KEY (id);
--
-- Name: workers workers_worker_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.workers
ADD CONSTRAINT workers_worker_id_key UNIQUE (worker_id);
--
-- Name: jobs_idempotency_key_unique; Type: INDEX; Schema: public; Owner: postgres
--
CREATE UNIQUE INDEX jobs_idempotency_key_unique ON public.jobs USING btree (idempotency_key);
--
-- PostgreSQL database dump complete
--
\unrestrict GbFdh7xvfHZmqf4tt31BSiP3TcUslvGiPUJwEQQvwG8t3f3B6BkCRIlDjVb8AI2