Dependent device DB migrations

This commit is contained in:
Joe Roberts 2017-06-13 09:38:16 +01:00
parent 786874dbb6
commit d4e3e45e52
No known key found for this signature in database
GPG Key ID: FB1B6AAE7664221D

View File

@ -81,6 +81,8 @@ knex.init = Promise.all([
t.string('imageId') t.string('imageId')
t.json('config') t.json('config')
t.json('environment') t.json('environment')
else
addColumn('dependentApp', 'environment', 'json')
knex.schema.hasTable('dependentDevice') knex.schema.hasTable('dependentDevice')
.then (exists) -> .then (exists) ->
@ -107,7 +109,12 @@ knex.init = Promise.all([
t.json('targetConfig') t.json('targetConfig')
t.boolean('markedForDeletion') t.boolean('markedForDeletion')
else else
addColumn('dependentDevice', 'markedForDeletion', 'boolean') Promise.all [
addColumn('dependentDevice', 'markedForDeletion', 'boolean')
addColumn('dependentDevice', 'localId', 'string')
addColumn('dependentDevice', 'is_managed_by', 'string')
addColumn('dependentDevice', 'lock_expiry_date', 'dateTime')
]
]) ])
module.exports = knex module.exports = knex