From d8810397a77a83d7041f5bc308b3612c4aab6bef Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 6 Jun 2022 15:19:42 +0700 Subject: [PATCH] example csv import command --- tubearchivist/postgres/indexsetup.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tubearchivist/postgres/indexsetup.sql b/tubearchivist/postgres/indexsetup.sql index 4c6c3f5..12c724b 100644 --- a/tubearchivist/postgres/indexsetup.sql +++ b/tubearchivist/postgres/indexsetup.sql @@ -12,6 +12,12 @@ CREATE TABLE ta_docker_stats ( -- index for time_stamp where queries CREATE INDEX docker_time_stamp ON ta_docker_stats (time_stamp DESC); +-- ingest old csv archive +COPY ta_docker_stats(time_stamp,time_stamp_human,last_updated,last_updated_human,stars,pulls) +FROM '/dockerstats.csv' +DELIMITER ',' +CSV HEADER; + -- create release history table CREATE TABLE ta_release ( id SERIAL NOT NULL PRIMARY KEY,