sync-docs-and-fixes
All checks were successful
CI / build-deploy (push) Successful in 4m39s

This commit is contained in:
SpecialX
2026-03-03 17:32:26 +08:00
parent 538805bad0
commit eb08c0ab68
73 changed files with 2218 additions and 422 deletions

View File

@@ -4,6 +4,7 @@ import { users, exams, questions, knowledgePoints, examSubmissions, examQuestion
import { createId } from "@paralleldrive/cuid2"
import { faker } from "@faker-js/faker"
import { eq } from "drizzle-orm"
import { hash } from "bcryptjs"
/**
* Seed Script for Next_Edu
@@ -19,6 +20,7 @@ const DIFFICULTY = [1, 2, 3, 4, 5]
async function seed() {
console.log("🌱 Starting seed process...")
const passwordHash = await hash("123456", 10)
// 1. Create a Teacher User if not exists
const teacherEmail = "teacher@example.com"
@@ -36,6 +38,7 @@ async function seed() {
email: teacherEmail,
role: "teacher",
image: "https://api.dicebear.com/7.x/avataaars/svg?seed=Teacher",
password: passwordHash,
})
} else {
teacherId = existingTeacher.id
@@ -54,6 +57,7 @@ async function seed() {
email: faker.internet.email(),
role: "student",
image: `https://api.dicebear.com/7.x/avataaars/svg?seed=${sId}`,
password: passwordHash,
})
}