// The default seed: the Aldenfell campaign (seed-data/aldenfell.js) for the // admin account. See seedCampaign.js for what a seed does and why it is safe // to run against a live database. // // npx prisma db seed add what is missing // npx prisma db seed -- --reset DESTRUCTIVE: delete every user, campaign, // character, note, etc. first // // Other campaigns have their own command (npm run seed:hollowcrown). // // Species/classes/skills are NOT seeded as rows — they're fixed game-rule // tables ported into src/game/data/*.js, as is the default weapon/spell/monster // library DMs pull from. The default weapons (seed-data/weapons.json) ARE // seeded, into the campaign, since weapons are per-campaign in the schema. const { run, fromLibrary } = require('./seedCampaign'); const { SPELL_LIBRARY } = require('../src/game/data/library'); const defaultWeapons = require('../seed-data/weapons.json'); const aldenfell = require('../seed-data/aldenfell.js'); run( { ...aldenfell, // Everyday weapons are what a new character picks from; the rest are earned. weapons: [...defaultWeapons.map((w) => ({ ...w, isStartingOption: true })), ...aldenfell.weapons], items: aldenfell.items.map(({ starting, ...item }) => ({ ...item, isStartingOption: Boolean(starting) })), spells: [ ...aldenfell.spells.starting.map((key) => fromLibrary(SPELL_LIBRARY, key, { isStartingOption: true })), ...aldenfell.spells.earned.map((key) => fromLibrary(SPELL_LIBRARY, key, { isStartingOption: false })), ], }, { reset: process.argv.includes('--reset') }, );