-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
39 lines (31 loc) · 759 Bytes
/
schema.sql
File metadata and controls
39 lines (31 loc) · 759 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
29
30
31
32
33
34
35
36
37
38
39
CREATE TABLE IF NOT EXISTS organizations (
id TEXT PRIMARY KEY,
name TEXT,
slug TEXT
);
CREATE TABLE IF NOT EXISTS projects (
id TEXT PRIMARY KEY,
name TEXT,
slug TEXT,
status TEXT,
organization_id TEXT UNSIGNED NOT NULL,
CONSTRAINT fk__projects__organizations
FOREIGN KEY (organization_id) REFERENCES organizations (id)
ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS issues (
id TEXT PRIMARY KEY,
title TEXT,
permalink TEXT,
has_seen BOOL,
first_seen TIMESTAMP,
last_seen TIMESTAMP,
user_count INT,
level TEXT,
status TEXT,
type TEXT,
project_id TEXT UNSIGNED NOT NULL,
CONSTRAINT fk__issues__projects
FOREIGN KEY (project_id) REFERENCES projects (id)
ON DELETE CASCADE
);