From af9ec6294d1d2a1a680b4c24acb86ca86b2303b9 Mon Sep 17 00:00:00 2001 From: dmorley Date: Wed, 11 Jan 2017 21:20:44 -0500 Subject: [PATCH] add sql updates --- db/migration00001.sql | 36 ++++++++++++++++++++++++++++++++++++ db/version.md | 4 ++++ 2 files changed, 40 insertions(+) create mode 100644 db/migration00001.sql create mode 100644 db/version.md diff --git a/db/migration00001.sql b/db/migration00001.sql new file mode 100644 index 0000000..cb04506 --- /dev/null +++ b/db/migration00001.sql @@ -0,0 +1,36 @@ +ALTER TABLE pods ADD terms text, ADD sslexpire timestamp, ADD uptime_custom text, ADD dnssec boolean, ADD masterversion text, ADD shortversion text; +ALTER TABLE pods DROP Hgitdate, DROP Hgitref, DROP Hruntime, DROP Hencoding, DROP longversion, DROP ptr, DROP whois, DROP postalcode, DROP connection, DROP pingdomlast; + +ALTER TABLE pods RENAME COLUMN pingdomurl TO statsurl; +ALTER TABLE pods RENAME COLUMN xmpp TO service_xmpp; +ALTER TABLE pods RENAME COLUMN uptimelast7 TO uptime_alltime; +ALTER TABLE pods RENAME COLUMN responsetimelast7 TO responsetimems; + +ALTER TABLE pods ALTER COLUMN ipv6 TYPE boolean USING ipv6::boolean; +ALTER TABLE pods ALTER hidden DROP DEFAULT; +ALTER TABLE pods ALTER COLUMN hidden TYPE boolean USING hidden::boolean; +ALTER TABLE pods ALTER COLUMN secure TYPE boolean USING secure::boolean; +ALTER TABLE pods ALTER COLUMN signup TYPE boolean USING signup::boolean; + +DROP TABLE users; + +CREATE TABLE apikeys ( + key text, + email text, + usage int, + dateCreated timestamp DEFAULT current_timestamp +); + +CREATE TABLE clicks ( + domain text, + manualclick int, + autoclick int, + dateClicked timestamp DEFAULT current_timestamp +); + +CREATE TABLE checks ( + domain text, + online boolean, + error text, + dateChecked timestamp DEFAULT current_timestamp +); diff --git a/db/version.md b/db/version.md new file mode 100644 index 0000000..7d5fd58 --- /dev/null +++ b/db/version.md @@ -0,0 +1,4 @@ +If new install import tables.sql + +If upgrading migrations are: +migration00001.sql -- GitLab