feat: add admin panel, Openinary media integration and standardized footer backlink
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
import bcrypt from 'bcryptjs'
|
||||
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
async function main() {
|
||||
const password = await bcrypt.hash('admin123', 10)
|
||||
const user = await prisma.user.upsert({
|
||||
where: { username: 'admin' },
|
||||
update: { password }, // update password if already exists
|
||||
create: {
|
||||
username: 'admin',
|
||||
password,
|
||||
},
|
||||
})
|
||||
console.log('Admin user created:', user.username)
|
||||
}
|
||||
|
||||
main()
|
||||
.then(async () => {
|
||||
await prisma.$disconnect()
|
||||
})
|
||||
.catch(async (e) => {
|
||||
console.error(e)
|
||||
await prisma.$disconnect()
|
||||
process.exit(1)
|
||||
})
|
||||
Reference in New Issue
Block a user