Skip to content

Instantly share code, notes, and snippets.

@AndrewGreen
Created September 5, 2018 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewGreen/1acf36b76eab53f01566c689ab2e4169 to your computer and use it in GitHub Desktop.
Save AndrewGreen/1acf36b76eab53f01566c689ab2e4169 to your computer and use it in GitHub Desktop.
use pgehres;
RENAME TABLE squidlog TO files;
ALTER TABLE files
ADD COLUMN directory VARCHAR(256) NOT NULL,
ADD COLUMN sample_rate INT(2) UNSIGNED DEFAULT NULL,
ADD COLUMN status ENUM('processing', 'consumed') NOT NULL,
ADD COLUMN consumed_events INT UNSIGNED DEFAULT NULL,
ADD COLUMN ignored_events INT UNSIGNED DEFAULT NULL,
ADD COLUMN invalid_events INT UNSIGNED DEFAULT NULL,
ADD INDEX timestamp_index (timestamp),
ADD INDEX status_index (status);
ALTER TABLE bannerimpressions
ADD COLUMN file_id INT(11) UNSIGNED NOT NULL,
ADD INDEX file_id_index (file_id);
ALTER TABLE landingpageimpression_raw
ADD COLUMN file_id INT(11) UNSIGNED NOT NULL,
ADD INDEX file_id_index (file_id);
ALTER TABLE donatewiki_unique
ADD COLUMN file_id INT(11) UNSIGNED NOT NULL,
ADD INDEX file_id_index (file_id);
CREATE VIEW squidlog AS SELECT id, filename, impressiontype, timestamp FROM files;
-- TODO: Fix permissions as necessary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment