const { user, article } = require('./models') async function main() { console.log(await user.findAll()) const author = await user.create({ name: 'author' }) const mod = await user.create({ name: 'moderator' }) const $article = await article.create({ title: 'Lorem Ipsum', submittedBy: author.id, reviewedBy: mod.id, }) await author.destroy() } main() .then(() => { console.log('done') process.exit(0) }) .catch(error => { console.error(`error: ${error}`) process.exit(1) })