mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
* Add unique index for `Migration`s * Fix proper use of `next` callback. First argument is potential error. * Update migration template
32 lines
555 B
JavaScript
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()
|
|
}
|
|
}
|