Skip to content

Commit

Permalink
speedtests migration
Browse files Browse the repository at this point in the history
  • Loading branch information
andymck committed Jul 27, 2023
1 parent 090bcb1 commit 6e15098
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mobile_verifier/migrations/15_speedtests_one_to_one.sql
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;

0 comments on commit 6e15098

Please sign in to comment.