Created
October 29, 2024 12:04
-
-
Save justinbalaguer/648a34d7ae29fdb0439a59618b8f7dcd to your computer and use it in GitHub Desktop.
This file contains 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 db from "./index" | |
const seed = async () => { | |
// hashed password = password123 | |
const hashedPassword = | |
"JGFyZ29uMmlkJHY9MTkkbT02NTUzNix0PTIscD0xJCtCUmJlbXpWTnhRTCtnVUxwZThHNnckaHkySU15OGlVOHp4WEl4VXphbjZRR2JLSUhVNDI1eTQ3azc1WEhxSDE4SQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" | |
const existingUser = await db.user.findFirst({ | |
where: { | |
email: "[email protected]", | |
}, | |
}) | |
if (!existingUser) { | |
await db.user.create({ | |
data: { | |
name: "Administrator", | |
email: "[email protected]", | |
role: "ADMIN", | |
hashedPassword, | |
}, | |
}) | |
} | |
} | |
export default seed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment