Skip to content
Permalink
Browse files

in postgresql, pageviews.timestamp column should be without timezone

  • Loading branch information...
dannyvankooten committed Nov 14, 2018
1 parent 2ca1e0f commit b5ee8ea5f010a1571062d2d33d6258ce650990f9
@@ -9,7 +9,7 @@ CREATE TABLE page_stats(
bounce_rate FLOAT NOT NULL,
known_durations INTEGER NOT NULL DEFAULT 0,
avg_duration FLOAT NOT NULL,
ts TIMESTAMP NOT NULL
ts TIMESTAMP WITHOUT TIME ZONE NOT NULL
);
INSERT INTO page_stats
SELECT site_id, hostname_id, pathname_id, pageviews, visitors, entries, bounce_rate, known_durations, avg_duration, (date || ' 00:00:00')::timestamp
@@ -9,7 +9,7 @@ CREATE TABLE referrer_stats(
bounce_rate FLOAT NOT NULL,
known_durations INTEGER NOT NULL DEFAULT 0,
avg_duration FLOAT NOT NULL,
ts TIMESTAMP NOT NULL
ts TIMESTAMP WITHOUT TIME ZONE NOT NULL
);
INSERT INTO referrer_stats
SELECT site_id, hostname_id, pathname_id, groupname, pageviews, visitors, bounce_rate, known_durations, avg_duration, (date || ' 00:00:00')::timestamp
@@ -7,7 +7,7 @@ CREATE TABLE site_stats(
bounce_rate FLOAT NOT NULL,
known_durations INTEGER NOT NULL DEFAULT 0,
avg_duration FLOAT NOT NULL,
ts TIMESTAMP NOT NULL
ts TIMESTAMP WITHOUT TIME ZONE NOT NULL
);
INSERT INTO site_stats
SELECT site_id, pageviews, visitors, sessions, bounce_rate, known_durations, avg_duration, (date || ' 00:00:00')::timestamp
@@ -0,0 +1,7 @@
-- +migrate Up

ALTER TABLE pageviews ALTER COLUMN timestamp TYPE TIMESTAMP WITHOUT TIME ZONE;

-- +migrate Down

ALTER TABLE pageviews ALTER COLUMN timestamp TYPE TIMESTAMP WITH TIME ZONE;

0 comments on commit b5ee8ea

Please sign in to comment.
You can’t perform that action at this time.