mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 07:06:37 +02:00
✨ Fix naming inconsistencies on migrations.
This commit is contained in:
parent
7d5f9c1078
commit
7bda554889
11 changed files with 87 additions and 33 deletions
40
backend/resources/migrations/0004-add-tasks-tables.sql
Normal file
40
backend/resources/migrations/0004-add-tasks-tables.sql
Normal file
|
@ -0,0 +1,40 @@
|
|||
CREATE TABLE task (
|
||||
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
|
||||
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||
modified_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||
completed_at timestamptz NULL DEFAULT NULL,
|
||||
scheduled_at timestamptz NOT NULL,
|
||||
priority smallint DEFAULT 100,
|
||||
|
||||
queue text NOT NULL,
|
||||
|
||||
name text NOT NULL,
|
||||
props bytea NOT NULL,
|
||||
|
||||
error text NULL DEFAULT NULL,
|
||||
|
||||
retry_num smallint NOT NULL DEFAULT 0,
|
||||
status text NOT NULL DEFAULT 'new'
|
||||
);
|
||||
|
||||
CREATE INDEX task__scheduled_at__queue__idx
|
||||
ON task (scheduled_at, queue);
|
||||
|
||||
CREATE TRIGGER task__modified_at__tgr
|
||||
BEFORE UPDATE ON task
|
||||
FOR EACH ROW EXECUTE PROCEDURE update_modified_at();
|
||||
|
||||
CREATE TABLE scheduled_task (
|
||||
id text PRIMARY KEY,
|
||||
|
||||
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||
modified_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||
executed_at timestamptz NULL DEFAULT NULL,
|
||||
|
||||
cron_expr text NOT NULL
|
||||
);
|
||||
|
||||
CREATE TRIGGER scheduled_task__modified_at__tgr
|
||||
BEFORE UPDATE ON scheduled_task
|
||||
FOR EACH ROW EXECUTE PROCEDURE update_modified_at();
|
Loading…
Add table
Add a link
Reference in a new issue