diff options
Diffstat (limited to 'migrations/sqls')
-rw-r--r-- | migrations/sqls/20151115192327-device-online-down.sql | 1 | ||||
-rw-r--r-- | migrations/sqls/20151115192327-device-online-up.sql | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/migrations/sqls/20151115192327-device-online-down.sql b/migrations/sqls/20151115192327-device-online-down.sql new file mode 100644 index 0000000..44f074e --- /dev/null +++ b/migrations/sqls/20151115192327-device-online-down.sql @@ -0,0 +1 @@ +/* Replace with your SQL commands */
\ No newline at end of file diff --git a/migrations/sqls/20151115192327-device-online-up.sql b/migrations/sqls/20151115192327-device-online-up.sql new file mode 100644 index 0000000..bd80a63 --- /dev/null +++ b/migrations/sqls/20151115192327-device-online-up.sql @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS device_status; +CREATE UNLOGGED TABLE device_status( + device BIGINT PRIMARY KEY REFERENCES device, + online BOOLEAN NOT NULL, + timestamp TIMESTAMPTZ NOT NULL, + host VARCHAR(1000) +); + +INSERT INTO device_status(device, online, timestamp) +SELECT id, false, created_timestamp FROM device; |