don't fail on fresh install
This commit is contained in:
parent
b870f84b71
commit
be99ab4f99
1 changed files with 8 additions and 0 deletions
|
|
@ -10,6 +10,14 @@ exports.up = function (next) {
|
||||||
'alter table devices alter column name set not null'
|
'alter table devices alter column name set not null'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
return db.multi(sql, next)
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
const sql = [
|
||||||
|
'alter table devices add column name text',
|
||||||
|
'alter table devices alter column name set not null'
|
||||||
|
]
|
||||||
|
|
||||||
return db.multi(sql, next)
|
return db.multi(sql, next)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue