ftest/migrations/20230927145504_ftest_jobs.sql

14 lines
457 B
MySQL
Raw Normal View History

CREATE TABLE IF NOT EXISTS ftest_job_states (
name VARcHAR(20) NOT NULL UNIQUE,
ID SERIAL PRIMARY KEY NOT NULL
);
CREATE TABLE IF NOT EXISTS ftest_jobs (
commit_hash VARCHAR(40) NOT NULL UNIQUE,
job_state INTEGER references ftest_job_states(ID) ON DELETE CASCADE,
created_at timestamptz NOT NULL DEFAULT now(),
scheduled_at timestamptz DEFAULT NULL,
finished_at timestamptz DEFAULT NULL,
ID SERIAL PRIMARY KEY NOT NULL
);