-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtweetdata.sql
36 lines (32 loc) · 999 Bytes
/
tweetdata.sql
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
CREATE DATABASE IF NOT EXISTS tweetdata
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'C'
LC_CTYPE = 'C'
TABLESPACE = pg_default
CONNECTION LIMIT = -1
IS_TEMPLATE = False;
CREATE TABLE IF NOT EXISTS dbo.rawtweet
( tweet_id varchar(200),
source_name varchar(100) DEFAULT '',
is_empty BOOLEAN NOT NULL DEFAULT FALSE,
is_retrieved BOOLEAN NOT NULL DEFAULT FALSE,
tweet_content BYTEA NOT NULL DEFAULT '',
parsed BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (tweet_id, source_name)
);
CREATE TABLE IF NOT EXISTS dbo.rawuser
(
id SERIAL PRIMARY KEY,
username varchar(200) UNIQUE,
is_empty BOOLEAN NOT NULL DEFAULT FALSE,
is_retrieved BOOLEAN NOT NULL DEFAULT FALSE,
user_content BYTEA NOT NULL DEFAULT '',
parsed BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE TABLE IF NOT EXISTS dbo.preloaded_dataset
(
dataset_name character varying(200) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT dataset_name_pkey PRIMARY KEY (dataset_name)
)