-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 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,15 @@ | ||
|
||
CREATE TABLE speedtests_migration ( | ||
id TEXT NOT NULL, | ||
upload_speed bigint, | ||
download_speed bigint, | ||
latency integer, | ||
timestamp TIMESTAMP NOT NULL | ||
); | ||
|
||
insert into speedtests_migration (id, upload_speed, download_speed, latency, timestamp) | ||
select id, (st).upload_speed, (st).download_speed, (st).latency, (st).timestamp | ||
from (select id, unnest(speedtests) as st from speedtests) as tmp; | ||
|
||
ALTER TABLE speedtests RENAME TO speedtests_old; | ||
ALTER TABLE speedtests_migration RENAME TO speedtests; |