This repository has been archived on 2026-03-07. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
c10y-complement-results/tables.sql
2026-03-05 09:54:55 -05:00

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;