Skip to content

Commit daf5a25

Browse files
committed
Fix some issues with the PR #2
1 parent f3098a1 commit daf5a25

File tree

4 files changed

+18
-41
lines changed

4 files changed

+18
-41
lines changed

load_into_pg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
134134

135135
parser.add_argument( '-u', '--username'
136136
, help = 'Username for the database.'
137-
, default = 'postgres'
137+
, default = None
138138
)
139139

140140
parser.add_argument( '-p', '--password'
141141
, help = 'Password for the database.'
142-
, default = 'fibinse'
142+
, default = None
143143
)
144144

145145
parser.add_argument( '-P', '--port'

sql/Comments_pre.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
DROP TABLE IF EXISTS Tags CASCADE;
1+
DROP TABLE IF EXISTS Comments CASCADE;
22
CREATE TABLE Comments (
3-
Id int PRIMARY KEY ,
4-
PostId int,
5-
Score int,
6-
Post_Text text,
7-
CreationDate timestamp not NULL ,
8-
UserId int
9-
);
3+
Id int PRIMARY KEY ,
4+
PostId int ,
5+
Score int ,
6+
Post_Text text ,
7+
CreationDate timestamp not NULL ,
8+
UserId int
9+
);

sql/PostHistory_post.sql

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,3 @@ CREATE INDEX ph_creation_date_idx ON PostHistory USING btree (CreationDate)
99
WITH (FILLFACTOR = 100);
1010
CREATE INDEX ph_userid_idx ON PostHistory USING btree (UserId)
1111
WITH (FILLFACTOR = 100);
12-
13-
14-
CREATE TABLE accepted_answer_id as SELECT DISTINCT acceptedanswerid FROM posts;
15-
16-
DROP TABLE qn_ans_timing;
17-
18-
CREATE TABLE qn_ans_timing AS
19-
SELECT
20-
p.id,
21-
p.tags,
22-
p.owneruserid,
23-
p.creationdate as qn_creation_ts,
24-
h.creationdate as ans_creation_ts,
25-
p.acceptedanswerid,
26-
h.userid as answered_by
27-
FROM posts p, posthistory h
28-
WHERE p.acceptedanswerid is not null
29-
AND h.postid in (
30-
SELECT *
31-
FROM accepted_answer_id
32-
)
33-
34-
AND p.acceptedanswerid=h.postid;

sql/PostHistory_pre.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
DROP TABLE IF EXISTS Tags CASCADE;
1+
DROP TABLE IF EXISTS PostHistory CASCADE;
22
CREATE TABLE PostHistory (
3-
Id int PRIMARY KEY ,
4-
PostHistoryTypeId int,
5-
PostId int,
6-
RevisionGUID text,
7-
CreationDate timestamp not NULL ,
8-
UserId int,
9-
PostText text
3+
Id int PRIMARY KEY ,
4+
PostHistoryTypeId int ,
5+
PostId int ,
6+
RevisionGUID text ,
7+
CreationDate timestamp not NULL ,
8+
UserId int ,
9+
PostText text
1010
);

0 commit comments

Comments
 (0)