Skip to content

Commit

Permalink
sql file commit
Browse files Browse the repository at this point in the history
  • Loading branch information
paleomedia committed Mar 19, 2015
1 parent 191f069 commit d200860
Showing 1 changed file with 72 additions and 11 deletions.
83 changes: 72 additions & 11 deletions nhoffman.sql
Original file line number Diff line number Diff line change
@@ -1,29 +1,90 @@
CREATE TABLE user (
CREATE TABLE IF NOT EXISTS users (
email VARCHAR(256) NOT NULL,
username VARCHAR(64) NOT NULL, PRIMARY KEY
username VARCHAR(64) NOT NULL PRIMARY KEY,
password VARCHAR(64) NOT NULL,
firstname VARCHAR(64),
lastname VARCHAR(64),
party VARCHAR(12),
website VARCHAR(64),
district_cong TINYINT,
district_leg TINYINT,);

district_leg TINYINT,
registered DATETIME,
verified BOOL
);

CREATE TABLE comments (
CREATE TABLE IF NOT EXISTS comments (
comment_id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(64),
comment
comment MEDIUMBLOB,
comment_link VARCHAR(200),
type VARCHAR(9),
votes_for TINYINT,
votes_against TINYINT,
flags TINYINT,
bill_id BIGINT(20),
comment_ip VARCHAR(100),
date DATETIME,
comment_parent BIGINT(20),
approved BOOL
);

CREATE TABLE IF NOT EXISTS topics (
topic_id BIGINT(20) NOT NULL PRIMARY KEY AUTO_INCREMENT,
topic VARCHAR(64)
);

CREATE TABLE IF NOT EXISTS bills_topics (
bill_id BIGINT(20),
topic_id BIGINT(20)
);

CREATE TABLE topics (
key
topic
CREATE TABLE IF NOT EXISTS bills (
bill_id BIGINT(20) NOT NULL PRIMARY KEY,
year YEAR(4),
title MEDIUMBLOB,
votes_for BIGINT(20),
votes_against BIGINT(20)
);

CREATE TABLE IF NOT EXISTS lawmakers (
leg_id VARCHAR(9) NOT NULL PRIMARY KEY,
first_name VARCHAR(32) NOT NULL,
last_name VARCHAR(32) NOT NULL,
middle_name VARCHAR(32),
suffix VARCHAR(8),
nickname VARCHAR(32),
district INT(2),
twitter VARCHAR(64),
facebook VARCHAR(64),
website VARCHAR(64),
party VARCHAR(24),
active BOOL,
chamber VARCHAR(12),
photo_url VARCHAR(64)
);

CREATE TABLE bills (
CREATE TABLE IF NOT EXISTS leg_geo (
district INT(2) PRIMARY KEY,
polygon POLYGON NOT NULL
);

CREATE TABLE IF NOT EXISTS user_bills (
bill_id BIGINT(20),
user_id VARCHAR(64)
);

CREATE TABLE lawmakers (
CREATE TABLE IF NOT EXISTS user_friends (
user_id VARCHAR(64),
friend_id VARCHAR(64)
);

CREATE TABLE IF NOT EXISTS user_topics (
user_id VARCHAR(64),
topic_id BIGINT(20)
);

CREATE TABLE IF NOT EXISTS user_lawmakers (
user_id VARCHAR(64),
lawmaker VARCHAR(9)
);

0 comments on commit d200860

Please sign in to comment.