-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
55 lines (53 loc) · 1.54 KB
/
schema.sql
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
CREATE TABLE issues (
source_system Enum8('GITHUB' = 0, 'JIRA' = 1),
project_owner LowCardinality(String),
project_name LowCardinality(String),
id UInt64,
parent_id UInt64,
assignee_username LowCardinality(String),
title String,
title_vector Array(Float32),
description String,
description_vector Array(Float32),
labels Array(String),
created_at DateTime64
)
ENGINE = MergeTree()
ORDER BY (source_system, project_owner, project_name, id)
PARTITION BY source_system;
CREATE TABLE issue_comments (
source_system Enum8('GITHUB' = 0, 'JIRA' = 1),
project_owner LowCardinality(String),
project_name LowCardinality(String),
issue_id UInt64,
id UInt64,
username LowCardinality(String),
body String,
body_vector Array(Float32),
created_at DateTime64
)
ENGINE = MergeTree()
ORDER BY (source_system, project_owner, project_name, issue_id, id)
PARTITION BY source_system;
CREATE TABLE issue_events (
source_system Enum8('GITHUB' = 0, 'JIRA' = 1),
project_owner LowCardinality(String),
project_name LowCardinality(String),
id UInt64,
related_object_id UInt64,
parent_id UInt64,
type Enum8(
'CREATED' = 0,
'UPDATED' = 1,
'CLOSED' = 2,
'COMMENT_ADDED' = 3,
'REOPENED' = 4,
'ASSIGNED' = 5,
'RESOLVED' = 6
),
assignee_username LowCardinality(String),
timestamp DateTime64
)
ENGINE = MergeTree()
ORDER BY (source_system, project_owner, project_name, id, related_object_id, timestamp)
PARTITION BY source_system;