mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
There was a single step definition that created a post and a comment. I would say let's put that in two different steps.
17 lines
522 B
JavaScript
17 lines
522 B
JavaScript
import { cleanDatabase } from '../db/factories'
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
throw new Error(`You cannot clean the database in production environment!`)
|
|
}
|
|
|
|
;(async function() {
|
|
try {
|
|
await cleanDatabase()
|
|
console.log('Successfully deleted all nodes and relations!') // eslint-disable-line no-console
|
|
process.exit(0)
|
|
} catch (err) {
|
|
console.log(`Error occurred deleting the nodes and relations (reset the db)\n\n${err}`) // eslint-disable-line no-console
|
|
process.exit(1)
|
|
}
|
|
})()
|