mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
46 lines
1.0 KiB
JavaScript
46 lines
1.0 KiB
JavaScript
import { getDriver } from '../../db/neo4j'
|
|
|
|
export const description = ''
|
|
|
|
export async function up(next) {
|
|
const driver = getDriver()
|
|
const session = driver.session()
|
|
const transaction = session.beginTransaction()
|
|
|
|
try {
|
|
// Implement your migration here.
|
|
await transaction.run(``)
|
|
await transaction.commit()
|
|
next()
|
|
} catch (error) {
|
|
// eslint-disable-next-line no-console
|
|
console.log(error)
|
|
await transaction.rollback()
|
|
// eslint-disable-next-line no-console
|
|
console.log('rolled back')
|
|
} finally {
|
|
session.close()
|
|
}
|
|
}
|
|
|
|
export async function down(next) {
|
|
const driver = getDriver()
|
|
const session = driver.session()
|
|
const transaction = session.beginTransaction()
|
|
|
|
try {
|
|
// Implement your migration here.
|
|
await transaction.run(``)
|
|
await transaction.commit()
|
|
next()
|
|
} catch (error) {
|
|
// eslint-disable-next-line no-console
|
|
console.log(error)
|
|
await transaction.rollback()
|
|
// eslint-disable-next-line no-console
|
|
console.log('rolled back')
|
|
} finally {
|
|
session.close()
|
|
}
|
|
}
|