From bcb16fc68126c57c0088120657df6bdccf727c9d Mon Sep 17 00:00:00 2001 From: Mosen Date: Sun, 10 Jul 2016 23:06:22 +1000 Subject: [PATCH] Add column unlock_token Store unlock_token on TokenUpdate message. --- 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;