Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Commit

Permalink
Fix Twitter Postgres/NoisePage DDL files
Browse files Browse the repository at this point in the history
  • Loading branch information
apavlo committed Sep 9, 2020
1 parent 19d4727 commit dc32a26
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
DROP TABLE IF EXISTS user_profiles CASCADE;
CREATE TABLE user_profiles (
uid int NOT NULL,
name varchar(255) DEFAULT NULL,
email varchar(255) DEFAULT NULL,
partitionid int DEFAULT NULL,
partitionid2 int DEFAULT NULL,
followers int DEFAULT NULL,
PRIMARY KEY (uid)
);
CREATE INDEX IDX_USER_FOLLOWERS ON user_profiles (followers);
CREATE INDEX IDX_USER_PARTITION ON user_profiles (partitionid);

DROP TABLE IF EXISTS followers;
CREATE TABLE followers (
f1 int NOT NULL,
f2 int NOT NULL,
PRIMARY KEY (f1,f2)
);

DROP TABLE IF EXISTS follows;
CREATE TABLE follows (
f1 int NOT NULL,
f2 int NOT NULL,
PRIMARY KEY (f1,f2)
);

DROP TABLE IF EXISTS tweets;
CREATE TABLE tweets (
id bigint NOT NULL,
uid int NOT NULL,
text char(140) NOT NULL,
createdate date DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE INDEX IDX_TWEETS_UID ON tweets (uid);

DROP TABLE IF EXISTS added_tweets;
CREATE TABLE added_tweets (
id bigint NOT NULL,
uid int NOT NULL,
text char(140) NOT NULL,
createdate date DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE INDEX IDX_ADDED_TWEETS_UID ON added_tweets (uid);
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ CREATE TABLE tweets (
createdate timestamp DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE INDEX IDX_TWEETS_UID ON tweets (uid);

-- TODO: id AUTO_INCREMENT
DROP TABLE IF EXISTS added_tweets;
Expand Down

0 comments on commit dc32a26

Please sign in to comment.