From 8b526c6aaa1acdaa92fc625cfc45e6226e6393d7 Mon Sep 17 00:00:00 2001 From: mosen Date: Fri, 7 Oct 2016 10:00:00 +1100 Subject: [PATCH] Add column unlock_token (#19) Store unlock_token on TokenUpdate message. (cherry picked from commit bcb16fc) --- device/datastore.go | 3 ++- migrations/201607100001_devices_unlock_token_down.sql | 4 ++++ migrations/201607100001_devices_unlock_token_up.sql | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 migrations/201607100001_devices_unlock_token_down.sql create mode 100644 migrations/201607100001_devices_unlock_token_up.sql diff --git a/device/datastore.go b/device/datastore.go index d6c68cbf..a0e87683 100644 --- a/device/datastore.go +++ b/device/datastore.go @@ -199,7 +199,8 @@ func (store pgStore) Save(msg string, dev *Device) error { awaiting_configuration=:awaiting_configuration, apple_push_magic=:apple_push_magic, apple_mdm_token=:apple_mdm_token, - mdm_enrolled=:mdm_enrolled + mdm_enrolled=:mdm_enrolled, + unlock_token=:unlock_token WHERE device_uuid=:device_uuid` case "checkout": stmt = `UPDATE devices SET diff --git a/migrations/201607100001_devices_unlock_token_down.sql b/migrations/201607100001_devices_unlock_token_down.sql new file mode 100644 index 00000000..c8731582 --- /dev/null +++ b/migrations/201607100001_devices_unlock_token_down.sql @@ -0,0 +1,4 @@ +ALTER TABLE + devices +DROP COLUMN unlock_token; + diff --git a/migrations/201607100001_devices_unlock_token_up.sql b/migrations/201607100001_devices_unlock_token_up.sql new file mode 100644 index 00000000..8e4728ad --- /dev/null +++ b/migrations/201607100001_devices_unlock_token_up.sql @@ -0,0 +1,3 @@ +ALTER TABLE + devices +ADD COLUMN unlock_token BYTEA;