EENE Dashboard upload to Gitea

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
EENE Dashboard
2026-06-17 16:59:34 +09:00
parent cf72281c6d
commit b3f2da203b
138 changed files with 13013 additions and 1929 deletions

View File

@@ -0,0 +1,28 @@
/**
* 로컬 DB가 비어 있을 때만 seed 실행 (최초 1회용)
*/
import 'dotenv/config';
import { execSync } from 'child_process';
import path from 'path';
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const users = await prisma.user.count();
if (users > 0) {
console.log('✓ Local DB has data — skip initial seed');
return;
}
console.log('📦 Empty local DB — loading initial sample data...');
const backendRoot = path.resolve(__dirname, '..');
execSync('tsx prisma/seed.ts', { stdio: 'inherit', cwd: backendRoot });
}
main()
.catch((err) => {
console.error(err);
process.exit(1);
})
.finally(() => prisma.$disconnect());