-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
38 lines (34 loc) · 1.03 KB
/
schema.sql
File metadata and controls
38 lines (34 loc) · 1.03 KB
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
DROP DATABASE IF EXISTS IssueHunt_Database;
CREATE DATABASE IF NOT EXISTS IssueHunt_Database;
# Holds basic repo data. Should only be modified when repositories are added or removed
CREATE TABLE IF NOT EXISTS IssueHunt_Database.Repos (
id INT AUTO_INCREMENT PRIMARY KEY,
name TEXT,
owner TEXT,
url TEXT,
insertedDate DATETIME DEFAULT CURRENT_TIMESTAMP
);
# Holds all general data from repo.
CREATE TABLE IF NOT EXISTS IssueHunt_Database.General_Data (
id INT AUTO_INCREMENT PRIMARY KEY,
repoID INT NOT NULL,
description TEXT,
langauge TEXT,
activeFunds DECIMAL(9, 2),
openIssues INT,
funded DECIMAL(9, 2),
retrievedDate DATE,
FOREIGN KEY (repoID) REFERENCES Repos(id)
);
# Holds issue to a repository
CREATE TABLE IF NOT EXISTS IssueHunt_Database.Issues (
id INT AUTO_INCREMENT PRIMARY KEY,
issueID INT NOT NULL,
repoID INT NOT NULL,
name TEXT,
url TEXT,
price DECIMAL(9, 2),
status TEXT,
createdBy TEXT,
FOREIGN KEY (repoID) REFERENCES Repos(id)
);