Skip to content

Commit d6ad3bc

Browse files
committed
Always create the Body field and populate only on request.
1 parent 06cf620 commit d6ad3bc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

load_into_pg.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
205205
, 'CreationDate'
206206
, 'Score'
207207
, 'ViewCount'
208-
# , 'Body'
208+
, 'Body'
209209
, 'OwnerUserId'
210210
, 'LastEditorUserId'
211211
, 'LastEditorDisplayName'
@@ -220,8 +220,9 @@ def handleTable(table, keys, dbname, mbDbFile, mbHost, mbPort, mbUsername, mbPas
220220
, 'CommunityOwnedDate'
221221
]
222222

223-
if args.with_post_body:
224-
keys.append('Body')
223+
# If the user has not explicitly asked for loading the body, we replace it with NULL
224+
if not args.with_post_body:
225+
specialRules[('Posts', 'Body')] = 'NULL'
225226

226227
elif table == 'Tags':
227228
keys = [

sql/Posts_pre.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ CREATE TABLE Posts (
77
CreationDate timestamp not NULL ,
88
Score int ,
99
ViewCount int ,
10-
-- Not storing the body currently
11-
-- Body text not NULL ,
10+
Body text ,
1211
OwnerUserId int ,
1312
LastEditorUserId int ,
1413
LastEditorDisplayName text ,

0 commit comments

Comments
 (0)