feat(storage): move project data to SQLite via node:sqlite
- server/db.mjs: schema (site + projects), transactional replace, WAL, VACUUM INTO backups (keep 10), JSON export, first-run seed from data/projects.json - publish.mjs: read/write through the database, export mirror JSON for git/static/offline, validate duplicate project_id - ui/data.js: read live data from /api/projects first, fall back to data/projects.json - Dockerfile/compose/.env.example: DB_PATH, drop experimental sqlite warning flag - docs: AGENTS.md + README describe the database layer and traps
This commit is contained in:
1 parent
830dba58ec
commit
5fb095b872
11 files changed
+364
-61
No files matched your search
@@ -12,5 +12,8 @@ ADMIN_TOKEN=
|
||||
# 1 = หลังบ้าน commit + push ขึ้น Gitea (ต้องมี .git ใน /app) · 0 = เขียนไฟล์อย่างเดียว
|
||||
PUBLISH_PUSH=0
|
||||
|
||||
# ที่อยู่ไฟล์ฐานข้อมูล SQLite (เทียบกับ root ของโปรเจค) — เว้นว่าง = data/hobbypj.sqlite
|
||||
DB_PATH=data/hobbypj.sqlite
|
||||
|
||||
# ชื่อ container
|
||||
CONTAINER_NAME=hobbypj-contents
|
||||
Reference in new issue
Block a user