mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
* push posts push posts * unpush posts * fix comment query * locales * fix locales * fix tests * Update webapp/locales/de.json Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com> * Update webapp/locales/de.json Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com> * Update webapp/locales/de.json Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com> * fix unpushedSuccessfully english message * remove paremeters from unpushPost * rename pushPostToTop -> pushPost, tests * update locales & tests webapp * fix lint --------- Co-authored-by: Wolfgang Huß <wolle.huss@pjannto.com>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
|
|
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(`
|
|
MATCH (p:Post)
|
|
SET p.sortDate = p.createdAt
|
|
`)
|
|
await transaction.commit()
|
|
} catch (error) {
|
|
// eslint-disable-next-line no-console
|
|
console.log(error)
|
|
await transaction.rollback()
|
|
// eslint-disable-next-line no-console
|
|
console.log('rolled back')
|
|
throw new Error(error)
|
|
} finally {
|
|
await 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(`
|
|
MATCH (p:Post)
|
|
REMOVE p.sortDate
|
|
`)
|
|
await transaction.commit()
|
|
} catch (error) {
|
|
// eslint-disable-next-line no-console
|
|
console.log(error)
|
|
await transaction.rollback()
|
|
// eslint-disable-next-line no-console
|
|
console.log('rolled back')
|
|
throw new Error(error)
|
|
} finally {
|
|
await session.close()
|
|
}
|
|
}
|