mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 02:01:35 +00:00
Merge pull request #354 from resin-io/353-deviceconfig-populate
If there's no entries in deviceConfig table, always create one.
This commit is contained in:
commit
e7388d6338
@ -28,8 +28,10 @@ knex.init = Promise.all([
|
||||
knex.schema.createTable 'deviceConfig', (t) ->
|
||||
t.json('values')
|
||||
t.json('targetValues')
|
||||
.then ->
|
||||
knex('deviceConfig').insert({ values: '{}', targetValues: '{}' })
|
||||
.then ->
|
||||
knex('deviceConfig').select()
|
||||
.then (deviceConfigs) ->
|
||||
knex('deviceConfig').insert({ values: '{}', targetValues: '{}' }) if deviceConfigs.length == 0
|
||||
|
||||
knex.schema.hasTable('app')
|
||||
.then (exists) ->
|
||||
|
Loading…
x
Reference in New Issue
Block a user