添加数据库自动初始化功能

- 创建 db/init.ts 脚本,可自动创建数据库和表
- 更新 db/index.ts,应用启动时自动检查并创建表结构
- 添加 bun run init-db 命令用于初始化数据库
- 更新 README.md 添加数据库初始化说明
This commit is contained in:
ethan.chen
2026-01-08 14:58:04 +08:00
parent 02ebb4c648
commit d296108f67
4 changed files with 155 additions and 2 deletions

View File

@@ -6,7 +6,8 @@
"main": "main.ts",
"scripts": {
"start": "bun run main.ts",
"dev": "bun --watch main.ts"
"dev": "bun --watch main.ts",
"init-db": "bun run db/init.ts"
},
"keywords": [],
"author": "",
@@ -18,4 +19,4 @@
"devDependencies": {
"@types/bun": "latest"
}
}
}