Index

public.exercise_repository_ssh_host_keys

Description

The ssh host key first seen when cloning an exercise repository from a git server whose key is not built into the application (trust on first use). A later clone from that server must present the same key. Kept per server rather than per repository because the key belongs to the server: one remembered key protects every repository on it.

Columns

Name Type Default Nullable Children Parents Comment
created_at timestamp with time zone now() false Timestamp when the key was first seen.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted. Deleting the row is how an administrator accepts a server’s legitimately changed key: the next clone remembers the new one.
host text false The git server’s host name as written in the clone URL, lowercased.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
port integer false The ssh port the clone connected to.
sha256_fingerprint text false The host key’s SHA-256 fingerprint, base64 without padding, as ssh-keygen -lf prints it after SHA256:.
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.

Constraints

Name Type Definition
exercise_repository_ssh_host_keys_created_at_not_null n NOT NULL created_at
exercise_repository_ssh_host_keys_host_is_lowercase CHECK CHECK ((host = lower(host)))
exercise_repository_ssh_host_keys_host_not_null n NOT NULL host
exercise_repository_ssh_host_keys_id_not_null n NOT NULL id
exercise_repository_ssh_host_keys_pkey PRIMARY KEY PRIMARY KEY (id)
exercise_repository_ssh_host_keys_port_not_null n NOT NULL port
exercise_repository_ssh_host_keys_port_range CHECK CHECK (((port >= 1) AND (port <= 65535)))
exercise_repository_ssh_host_keys_sha256_fingerprint_not_null n NOT NULL sha256_fingerprint
exercise_repository_ssh_host_keys_updated_at_not_null n NOT NULL updated_at

Indexes

Name Definition
exercise_repository_ssh_host_keys_pkey CREATE UNIQUE INDEX exercise_repository_ssh_host_keys_pkey ON public.exercise_repository_ssh_host_keys USING btree (id)
idx_exercise_repository_ssh_host_keys_host_port CREATE UNIQUE INDEX idx_exercise_repository_ssh_host_keys_host_port ON public.exercise_repository_ssh_host_keys USING btree (host, port, deleted_at) NULLS NOT DISTINCT

Triggers

Name Definition
set_timestamp CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.exercise_repository_ssh_host_keys FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls