CREATE TYPE visibility AS ENUM ( 'public', 'unlisted', 'private' ); CREATE TABLE IF NOT EXISTS repositories ( username TEXT NOT NULL, instance_url TEXT NOT NULL, name TEXT NOT NULL, description TEXT, visibility visibility NOT NULL, default_branch TEXT NOT NULL ); CREATE UNIQUE INDEX unique_name_per_user ON repositories (username, instance_url, name);