34 lines
962 B
SQL
34 lines
962 B
SQL
CREATE TABLE IF NOT EXISTS runs (
|
|
id INTEGER PRIMARY KEY,
|
|
run_date DATE DEFAULT CURRENT_DATE,
|
|
run_time TIME DEFAULT CURRENT_TIME,
|
|
commit_hash TEXT NOT NULL,
|
|
pr_number INTEGER,
|
|
branch_or_pr_name TEXT,
|
|
author_name TEXT NOT NULL,
|
|
passed_count INTEGER DEFAULT 0,
|
|
skipped_count INTEGER DEFAULT 0,
|
|
failed_count INTEGER DEFAULT 0
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS run_details (
|
|
id INTEGER PRIMARY KEY,
|
|
run_id INTEGER NOT NULL,
|
|
file_name TEXT NOT NULL,
|
|
status TEXT NOT NULL, -- 'pass', 'skip', or 'fail'
|
|
FOREIGN KEY (run_id) REFERENCES runs(id) ON DELETE CASCADE
|
|
);
|
|
|
|
-- View to easily see tests joined with their run info
|
|
CREATE VIEW IF NOT EXISTS run_tests_view AS
|
|
SELECT
|
|
runs.run_date,
|
|
runs.run_time,
|
|
runs.commit_hash,
|
|
runs.pr_number,
|
|
runs.branch_or_pr_name,
|
|
runs.author_name,
|
|
run_details.file_name,
|
|
run_details.status
|
|
FROM runs
|
|
JOIN run_details ON runs.id = run_details.run_id;
|