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

17 lines
605 B
SQL

CREATE TABLE users (
id VARCHAR(20) PRIMARY KEY, -- user id
login VARCHAR(64) UNIQUE NOT NULL, -- github login
name VARCHAR(128), -- user name
email VARCHAR(128), -- user email, if present
token VARCHAR(40) NOT NULL, -- github oauth token
address VARCHAR(42), -- ETH address
created TIME -- user created date
);
CREATE TABLE repositories (
login VARCHAR(64) NOT NULL, -- github user
repo VARCHAR(64) NOT NULL, -- github repo
updated TIME, -- date of the last crawl
CONSTRAINT repositories_user_repo_pk PRIMARY KEY (login, repo) -- composite primary key
);