open-bounty/resources/migrations/20160820210822-init.up.sql

42 lines
925 B
MySQL
Raw Normal View History

2016-08-28 20:16:45 +00:00
CREATE TABLE users
(
id INTEGER PRIMARY KEY NOT NULL,
login VARCHAR(64) NOT NULL,
name VARCHAR(128),
email VARCHAR(128),
token VARCHAR(40),
address VARCHAR(42),
created TIME
2016-08-20 21:36:30 +00:00
);
2016-08-24 22:46:29 +00:00
CREATE TABLE repositories
(
2016-08-28 20:16:45 +00:00
repo_id INTEGER PRIMARY KEY NOT NULL,
user_id INTEGER,
login VARCHAR(64) NOT NULL,
repo VARCHAR(64) NOT NULL,
updated TIME,
enabled BOOLEAN DEFAULT TRUE,
hook_id INTEGER
2016-08-20 21:36:30 +00:00
);
CREATE TABLE issues
(
repo_id INTEGER NOT NULL,
issue_id INTEGER NOT NULL,
2016-08-28 20:16:45 +00:00
issue_number INTEGER,
title VARCHAR(256),
address VARCHAR(256),
commit_id VARCHAR(40),
CONSTRAINT issues_repo_id_issue_id_pk PRIMARY KEY (repo_id, issue_id)
2016-08-28 20:16:45 +00:00
);
CREATE TABLE pull_requests
(
pr_id INTEGER PRIMARY KEY NOT NULL,
pr_number INTEGER,
repo_id INTEGER,
user_id INTEGER,
parents VARCHAR(4099) -- 100 commit SHAs + 99 commas
);