Merge pull request #1584 from balena-io/1581-patch-commit-constraint

Prevent inserting null commit during DB migration
This commit is contained in:
bulldozer-balena[bot] 2021-02-03 16:25:07 +00:00 committed by GitHub
commit 001f544c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ export async function up(knex) {
const currentCommit = await knex('config')
.where({ key: 'currentCommit' })
.select('value');
if (currentCommit[0] != null) {
if (currentCommit[0] != null && currentCommit[0].value != null) {
const apps = await knex('app').select(['appId']);
for (const app of apps) {