~vpzom/lotide

ref: 6f183c37ed24dfe1b8fc69a68f31b10bda3e49bd lotide/migrations/20200703211425_tasks/up.sql -rw-r--r-- 408 bytes
6f183c37Colin Reeder Update docs with new env variables 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
BEGIN;
	CREATE TYPE lt_task_state AS ENUM ('pending', 'running', 'completed', 'failed');

	CREATE TABLE task (
		id BIGSERIAL PRIMARY KEY,
		state lt_task_state NOT NULL DEFAULT ('pending'),
		kind TEXT NOT NULL,
		params JSON NOT NULL,
		max_attempts SMALLINT NOT NULL,
		attempts SMALLINT NOT NULL DEFAULT (0),
		latest_error TEXT,
		created_at TIMESTAMPTZ NOT NULL,
		completed_at TIMESTAMPTZ
	);
COMMIT;