Skip to content

Commit

Permalink
Unite structure
Browse files Browse the repository at this point in the history
  • Loading branch information
laschuet committed Apr 15, 2019
1 parent 0230c64 commit 141b11b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 35 deletions.
27 changes: 27 additions & 0 deletions src/ParticipationData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@ using Gumbo
using SQLite
using XLSX

#=
Common contribution and comment structure
Contribution:
id internal, primary key
number id from data source
author
content
ref
created_at
modified_at
pos_ratings
neg_ratings
assessment_decision
assessment_content
Comment:
id internal, primary key
number id from data source
author
content
reply_to
created_at
pos_ratings
neg_ratings
=#

export liqd,
mwp

Expand Down
58 changes: 29 additions & 29 deletions src/liqd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ function create_table_type_1(dbname, tablename)
CREATE TABLE IF NOT EXISTS $tablename (
id INTEGER PRIMARY KEY,
link TEXT NOT NULL,
org_name TEXT NOT NULL,
org_website TEXT NOT NULL,
org_country TEXT NOT NULL,
org_city TEXT NOT NULL,
idea_title TEXT NOT NULL,
idea_subtitle TEXT NOT NULL,
idea_pitch TEXT NOT NULL,
author TEXT NOT NULL,
author_website TEXT NOT NULL,
author_country TEXT NOT NULL,
author_city TEXT NOT NULL,
title TEXT NOT NULL,
subtitle TEXT NOT NULL,
content TEXT NOT NULL,
topic TEXT NOT NULL,
other TEXT,
how TEXT NOT NULL,
method TEXT NOT NULL,
outcome TEXT NOT NULL,
importance TEXT NOT NULL,
for_whom TEXT NOT NULL,
target_group TEXT NOT NULL,
uniqueness TEXT NOT NULL,
on_shortlist INTEGER,
is_winner INTEGER,
assessment_comment TEXT,
asessement_decision INTEGER,
assessment_content TEXT,
community_winner INTEGER,
created_at TEXT NOT NULL,
modified_at TEXT NOT NULL,
Expand All @@ -38,24 +38,24 @@ function create_table_type_2(dbname, tablename)
dbconn = SQLite.DB(dbname)
SQLite.execute!(dbconn, """
CREATE TABLE IF NOT EXISTS $tablename (
id INTEGER PRIMARY KEY,
ref TEXT NOT NULL,
link TEXT NOT NULL,
title TEXT NOT NULL,
description TEXT NOT NULL,
pos_ratings INTEGER NOT NULL,
neg_ratings INTEGER NOT NULL,
category TEXT NOT NULL,
features TEXT,
num_comments INTEGER NOT NULL,
long REAL NOT NULL,
lat REAL NOT NULL,
location TEXT,
mod_response TEXT,
off_response TEXT,
notice TEXT,
author TEXT NOT NULL,
created_at TEXT NOT NULL
id INTEGER PRIMARY KEY,
ref TEXT NOT NULL,
link TEXT NOT NULL,
title TEXT NOT NULL,
content TEXT NOT NULL,
pos_ratings INTEGER NOT NULL,
neg_ratings INTEGER NOT NULL,
category TEXT NOT NULL,
features TEXT,
num_comments INTEGER NOT NULL,
long REAL NOT NULL,
lat REAL NOT NULL,
location TEXT,
mod_response TEXT,
assessment_content TEXT,
note TEXT,
author TEXT NOT NULL,
created_at TEXT NOT NULL
);
""")
end
Expand Down
12 changes: 6 additions & 6 deletions src/mwp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ function create(dbname, tablename)
dbconn = SQLite.DB("$dbname.db")
SQLite.execute!(dbconn, """
CREATE TABLE IF NOT EXISTS $tablename (
id INTEGER PRIMARY KEY,
number INTEGER,
participant TEXT,
ref TEXT,
content TEXT NOT NULL,
assessment TEXT
id INTEGER PRIMARY KEY,
number INTEGER,
author TEXT,
ref TEXT,
content TEXT NOT NULL,
assessment_content TEXT
);
""")
end
Expand Down

0 comments on commit 141b11b

Please sign in to comment.