Index

public.exercise_repositories

Description

A git repository that contains exercises.

Columns

Name Type Default Nullable Children Parents Comment
branch varchar(255) true The git branch to sync from. If null, the default branch of the remote is used.
course_id uuid true public.courses Each repository is related to some course. The same repository can be added to different courses and managed separately.
created_at timestamp with time zone now() false Timestamp when the record was created.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
deploy_key varchar(1024) true If set, the key will be used to access the repository.
error_message text true If something went wrong when processing this repository, this column may contain information about the error.
exam_id uuid true public.exams
id uuid uuid_generate_v4() false public.repository_exercises public.retired_repository_exercise_archives A unique, stable identifier for the record.
last_sync_report jsonb true What the latest successful sync changed, shown to teachers: exercises added, updated, renamed and removed, and exercise tasks refreshed or failed.
last_synced_at timestamp with time zone true When the latest successful sync finished.
public_key varchar(1024) true The public SSH key associated with the deploy key.
status exercise_repository_status ‘pending’::exercise_repository_status false Pending while a sync is queued or running, success after the latest sync succeeded, failure once a sync has failed too many times in a row.
sync_attempts integer 0 false Syncs started since the last request or success, the running one included. The repository is marked failed once a sync fails or dies at the worker’s limit.
sync_requested_at timestamp with time zone now() false When a sync was last asked for. A sync that started before this time is followed by another one.
sync_started_at timestamp with time zone true When the sync worker started the running sync, or null when none is running. A sync running for too long is assumed dead and started again.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.
url varchar(255) false The git url for the repository.

Constraints

Name Type Definition
exercise_repositories_check CHECK CHECK (((course_id IS NULL) <> (exam_id IS NULL)))
exercise_repositories_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
exercise_repositories_created_at_not_null n NOT NULL created_at
exercise_repositories_exam_id_fkey FOREIGN KEY FOREIGN KEY (exam_id) REFERENCES exams(id)
exercise_repositories_id_not_null n NOT NULL id
exercise_repositories_pkey PRIMARY KEY PRIMARY KEY (id)
exercise_repositories_status_not_null n NOT NULL status
exercise_repositories_sync_attempts_not_null n NOT NULL sync_attempts
exercise_repositories_sync_requested_at_not_null n NOT NULL sync_requested_at
exercise_repositories_updated_at_not_null n NOT NULL updated_at
exercise_repositories_url_not_null n NOT NULL url

Indexes

Name Definition
exercise_repositories_pkey CREATE UNIQUE INDEX exercise_repositories_pkey ON public.exercise_repositories USING btree (id)

Relations

er

Generated by tbls