Commit 7c7959fd authored by Audrey Hamelers's avatar Audrey Hamelers

#824 move/improve seeding logic a bit

parent 8834a622
Pipeline #13005 passed with stages
in 5 minutes and 41 seconds
......@@ -10,7 +10,14 @@ const journals = require('../config/journals.json')
async function seed() {
try {
// const journals = config.get('journals')
await Journal.upsertMulti(journals)
const natureJournal = await Journal.findByField('meta,pmjrid', '6011')
if (natureJournal.length > 0) {
logger.info('Will not run journals seed.')
} else {
logger.info('Seeding journals.')
await Journal.upsertMulti(journals)
}
const users = config.get('users')
/* eslint-disable no-await-in-loop */
......@@ -33,11 +40,10 @@ async function seed() {
await new User(user).save()
}
}
logger.info('Seeding complete.')
} catch (e) {
logger.warn('Could not load any seeds', e)
}
logger.info('Seeding complete.')
}
;(async () => {
......
......@@ -7,4 +7,5 @@ exports.up = (knex, Promise) =>
exports.down = (knex, Promise) =>
knex.schema.table('manuscript', t => {
t.dropColumn('meta,pmjrid')
t.timestamp('date_revised')
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment