11 lines
421 B
MySQL
11 lines
421 B
MySQL
|
CREATE TABLE IF NOT EXISTS watchdogs (
|
||
|
id UUID PRIMARY KEY NOT NULL,
|
||
|
project_id UUID UNIQUE NOT NULL REFERENCES projects (id) ON DELETE RESTRICT,
|
||
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||
|
last_set_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||
|
expiration TIMESTAMPTZ NOT NULL,
|
||
|
notified BOOLEAN NOT NULL DEFAULT FALSE
|
||
|
);
|
||
|
CREATE INDEX ON watchdogs (project_id);
|
||
|
CREATE INDEX ON watchdogs (expiration);
|