roschaefer a86b26a756 Various fixes for data migrations
* Add unique index for `Migration`s
* Fix proper use of `next` callback. First argument is potential error.
* Update migration template
2020-01-20 17:25:36 +01:00

32 lines
555 B
JavaScript

import { getDriver } from '../../db/neo4j'
export const description = ''
export function up(next) {
const driver = getDriver()
const session = driver.session()
try {
// Implement your migration here.
next()
} catch (err) {
next(err)
} finally {
session.close()
driver.close()
}
}
export function down(next) {
const driver = getDriver()
const session = driver.session()
try {
// Rollback your migration here.
next()
} catch (err) {
next(err)
} finally {
session.close()
driver.close()
}
}