forked from nchah/github-traffic-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update code to send to PSQL instead of csv file
- Loading branch information
Showing
2 changed files
with
131 additions
and
3 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,37 @@ | ||
-- These tables are an alternative to the CSV files being created | ||
|
||
DROP TABLE IF EXISTS repo_overview; | ||
DROP TABLE IF EXISTS repo_visitors; | ||
DROP TABLE IF EXISTS repo_clones; | ||
DROP TABLE IF EXISTS repo_referrals; | ||
|
||
CREATE TABLE repo_overview( | ||
create_timestamp DATE NOT NULL DEFAULT DATE(NOW()), -- date of generated results | ||
Repo_Name VARCHAR(255) NOT NULL DEFAULT '', | ||
Result_Type VARCHAR(255) NOT NULL DEFAULT '', | ||
Uniques INT NOT NULL DEFAULT 0, | ||
Total INT NOT NULL DEFAULT 0 | ||
); | ||
|
||
CREATE TABLE repo_visitors( | ||
Repo_Name VARCHAR(255) NOT NULL DEFAULT '', | ||
create_timestamp DATE NOT NULL DEFAULT DATE(NOW()), | ||
Uniques INT NOT NULL DEFAULT 0, | ||
Total INT NOT NULL DEFAULT 0 | ||
); | ||
|
||
|
||
CREATE table repo_clones( | ||
Repo_Name VARCHAR(255) NOT NULL DEFAULT '', | ||
create_timestamp DATE NOT NULL DEFAULT DATE(NOW()), | ||
Uniques INT NOT NULL DEFAULT 0, | ||
Total INT NOT NULL DEFAULT 0 | ||
); | ||
|
||
CREATE TABLE repo_referrals( | ||
Repo_Name VARCHAR(255) NOT NULL DEFAULT '', | ||
Referral VARCHAR(255) NOT NULL DEFAULT '', | ||
Uniques INT NOT NULL DEFAULT 0, | ||
Total INT NOT NULL DEFAULT 0 | ||
); | ||
|
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