Update prisma seed files.

This commit is contained in:
Mike Cao 2022-03-31 19:25:04 -07:00
parent f0b207f6a2
commit afe68f6e21
3 changed files with 1 additions and 4 deletions

View File

@ -1 +0,0 @@
../seed.js

View File

@ -1 +0,0 @@
../seed.js

View File

@ -8,13 +8,12 @@ const hashPassword = password => {
};
async function main() {
const password = hashPassword(process.env.ADMIN_PASSWORD || 'umami');
await prisma.account.upsert({
where: { username: 'admin' },
update: {},
create: {
username: 'admin',
password: password,
password: hashPassword(process.env.ADMIN_PASSWORD || 'umami'),
is_admin: true,
},
});