<commit_before>CREATE TABLE IF NOT EXISTS grading_logs (
    id BIGSERIAL PRIMARY KEY,
    date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
    submission_id BIGINT NOT NULL REFERENCES submissions ON DELETE CASCADE ON UPDATE CASCADE,
    grading_method enum_grading_method,
    grading_requested_at TIMESTAMP WITH TIME ZONE,
    grading_request_canceled_at TIMESTAMP WITH TIME ZONE,
    grading_request_canceled_by BIGINT REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE,
    graded_at TIMESTAMP WITH TIME ZONE,
    graded_by BIGINT REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE,
    score DOUBLE PRECISION,
    correct BOOLEAN,
    feedback JSONB,
    auth_user_id BIGINT REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE
);

CREATE INDEX IF NOT EXISTS grading_logs_submission_id_idx ON grading_logs (submission_id);<commit_msg>Added autograding start/finish time columns to grading logs<commit_after>CREATE TABLE IF NOT EXISTS grading_logs (
    id BIGSERIAL PRIMARY KEY,
    date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
    submission_id BIGINT NOT NULL REFERENCES submissions ON DELETE CASCADE ON UPDATE CASCADE,
    grading_method enum_grading_method,
    grading_requested_at TIMESTAMP WITH TIME ZONE,
    grading_request_canceled_at TIMESTAMP WITH TIME ZONE,
    grading_request_canceled_by BIGINT REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE,
    graded_at TIMESTAMP WITH TIME ZONE,
    graded_by BIGINT REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE,
    score DOUBLE PRECISION,
    correct BOOLEAN,
    feedback JSONB,
    auth_user_id BIGINT REFERENCES users ON DELETE CASCADE ON UPDATE CASCADE,
    autograde_started_at TIMESTAMP WITH TIME ZONE,
    autograde_finished_at TIMESTAMP WITH TIME ZONE
);

CREATE INDEX IF NOT EXISTS grading_logs_submission_id_idx ON grading_logs (submission_id);

ALTER TABLE grading_logs ADD COLUMN IF NOT EXISTS autograde_started_at TIMESTAMP WITH TIME ZONE;
ALTER TABLE grading_logs ADD COLUMN IF NOT EXISTS autograde_finished_at TIMESTAMP WITH TIME ZONE;
{'fraction_non_alphanumeric': 0.022960429897410845, 'fraction_numerical': 0.0, 'mean_word_length': 4.91907514450867, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4085120', 'n_tokens_mistral': 709, 'n_tokens_neox': 647, 'n_words': 226}