Created
January 13, 2023 04:45
-
-
Save dipeshhkc/13227c304ea63b6f826582ef4cfd9f4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PrismaClient } from '@prisma/client'; | |
const db = new PrismaClient(); | |
import { add } from 'date-fns'; | |
async function seed() { | |
await Promise.all( | |
getUsers().map((user) => { | |
return db.user.create({ data: user }); | |
}) | |
); | |
} | |
seed(); | |
function getUsers() { | |
return [ | |
{ | |
email: '[email protected]', | |
trial_ends_at: add(new Date(), { weeks: 1 }), | |
}, | |
{ | |
email: '[email protected]', | |
trial_ends_at: add(new Date(), { weeks: 1 }), | |
}, | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment