-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathschema.sql
More file actions
28 lines (25 loc) · 909 Bytes
/
schema.sql
File metadata and controls
28 lines (25 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
CREATE TABLE IF NOT EXISTS repositories (
id uuid PRIMARY KEY,
created_at timestamptz,
updated_at timestamptz,
endpoints text[],
status varchar(20),
fetched_at timestamptz,
fetch_error_at timestamptz,
last_commit_at timestamptz,
is_fork boolean
);
CREATE INDEX IF NOT EXISTS idx_repositories_endpoints on "repositories" USING GIN ("endpoints");
CREATE TABLE IF NOT EXISTS repository_references (
id uuid PRIMARY KEY,
created_at timestamptz,
updated_at timestamptz,
name text,
repository_id uuid references repositories(id),
hash text,
init text,
roots text[],
reference_time timestamptz
);
CREATE INDEX IF NOT EXISTS idx_references_repository_id ON "repository_references" ("repository_id");
CREATE INDEX IF NOT EXISTS idx_references_init ON "repository_references" ("init");