Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add different language for wiki. There are two main modifications. Th…
…e first is adding a value when crawing from wikimedia. The second thing is modify the epidata server pip file to make it compatible with the language parameter
- Loading branch information
Showing
11 changed files
with
369 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__pycache__/ | ||
.DS_Store | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE `wiki_meta`( | ||
`id` INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, | ||
`datetime` DATETIME NOT NULL , | ||
`date` date NOT NULL , | ||
`epiweek` INT(11) NOT NULL , | ||
`total` INT(11) NOT NULL , | ||
UNIQUE KEY `datetime` (`datetime`) | ||
); | ||
|
||
# Add a column `language` to the wiki_meta table | ||
ALTER TABLE `wiki_meta` | ||
ADD `language` CHAR(2) NOT NULL DEFAULT 'en'; | ||
|
||
# Another step is to update the UNIQUE KEY | ||
ALTER TABLE `wiki_meta` | ||
DROP INDEX `datetime`, | ||
ADD UNIQUE KEY `datetime` (`datetime`, `language`); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE `wiki_raw` ( | ||
`id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, | ||
`name` varchar(64) NOT NULL, | ||
`hash` char(32) NOT NULL, | ||
`status` int(11) NOT NULL DEFAULT '0', | ||
`size` int(11) DEFAULT NULL, | ||
`datetime` datetime DEFAULT NULL, | ||
`worker` varchar(256) DEFAULT NULL, | ||
`elapsed` float DEFAULT NULL, | ||
`data` varchar(2048) DEFAULT NULL, | ||
UNIQUE KEY `name` (`name`), | ||
KEY `status` (`status`) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
CREATE TABLE `wiki`( | ||
`id` INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT, | ||
`datetime` DATETIME NOT NULL , | ||
`article` VARCHAR(64) NOT NULL , | ||
`count` INT(11) NOT NULL , | ||
UNIQUE KEY `datetime` (`datetime`, `article`), | ||
KEY `datetime_2` (`datetime`), | ||
KEY `article` (`article`) | ||
); | ||
|
||
# Add a column `language` to the wiki table | ||
ALTER TABLE `wiki` | ||
ADD `language` CHAR(2) NOT NULL DEFAULT 'en'; | ||
|
||
# Another step is to update the UNIQUE KEY | ||
ALTER TABLE `wiki` | ||
DROP INDEX `datetime`, | ||
ADD UNIQUE KEY `datetime` (`datetime`, `article`, `language`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.