mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
throw error added to template
This commit is contained in:
parent
31cec2cf0c
commit
5b41561cc4
@ -18,6 +18,7 @@ export async function up(next) {
|
||||
await transaction.rollback()
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('rolled back')
|
||||
throw new Error(error)
|
||||
} finally {
|
||||
session.close()
|
||||
}
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
import { getDriver } from '../../db/neo4j'
|
||||
|
||||
export const description =
|
||||
'This migration swaps the value stored in Location.lat with the value of Location.lng.'
|
||||
export const description = `
|
||||
This migration swaps the value stored in Location.lat with the value
|
||||
of Location.lng. This is necessary as the values of lat and lng were
|
||||
stored incorrectly. For example Hamburg, Germany, was stored with the
|
||||
values lat=10.0 and lng=53.55, which is close to the horn of Africa,
|
||||
but it is lat=53.55 and lng=10.0
|
||||
`
|
||||
|
||||
const swap = async function(next) {
|
||||
const driver = getDriver()
|
||||
@ -11,8 +16,8 @@ const swap = async function(next) {
|
||||
// Implement your migration here.
|
||||
await transaction.run(`
|
||||
MATCH (l:Location) WHERE NOT(l.lat IS NULL)
|
||||
WITH l.lng AS longitude, l.lat AS latitude, l AS Location
|
||||
SET Location.lat = longitude, Location.lng = latitude
|
||||
WITH l.lng AS longitude, l.lat AS latitude, l AS location
|
||||
SET location.lat = longitude, location.lng = latitude
|
||||
`)
|
||||
await transaction.commit()
|
||||
next()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user