mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
RedwoodJS [v0.25.0](https://github.com/redwoodjs/redwood/releases/tag/v0.25.0) changed to a different build command: [yarn rw deploy vercel](https://redwoodjs.com/docs/cli-commands#vercel) This also updates the example to use the latest template from `created-redwood-app`.
29 lines
928 B
JavaScript
29 lines
928 B
JavaScript
/* eslint-disable no-console */
|
|
const { PrismaClient } = require('@prisma/client')
|
|
const dotenv = require('dotenv')
|
|
|
|
dotenv.config()
|
|
const db = new PrismaClient()
|
|
|
|
async function main() {
|
|
// https://www.prisma.io/docs/guides/prisma-guides/seed-database
|
|
//
|
|
// Seed data is database data that needs to exist for your app to run.
|
|
// Ideally this file should be idempotent: running it multiple times
|
|
// will result in the same database state (usually by checking for the
|
|
// existence of a record before trying to create it). For example:
|
|
//
|
|
// const existing = await db.user.findMany({ where: { email: 'admin@email.com' }})
|
|
// if (!existing.length) {
|
|
// await db.user.create({ data: { name: 'Admin', email: 'admin@email.com' }})
|
|
// }
|
|
|
|
console.info('No data to seed. See api/db/seed.js for info.')
|
|
}
|
|
|
|
main()
|
|
.catch((e) => console.error(e))
|
|
.finally(async () => {
|
|
await db.$disconnect()
|
|
})
|