refactor(db): switch records layer to Prisma
- Replace hand-written node:sqlite queries with a Prisma client using the better-sqlite3 driver adapter - Version the schema with migrations: baseline table, timestamp normalisation, and WAL journal mode - Store timestamps with an explicit UTC offset so they stop being parsed as local time - Show created/updated times on the edit page, formatted with dayjs - Move the root redirect into next.config to avoid a prerender error - Run migrations from the container entrypoint before starting the server BREAKING CHANGE: DNSMASQ_ADMIN_DB_PATH is replaced by DATABASE_URL, which must be a Prisma connection URL (file:./data/dnsmasq-admin.db). Existing database files are migrated in place and need no conversion.
This commit is contained in:
25 files changed
+1796
-141
No files matched your search
@@ -0,0 +1,23 @@
|
||||
# Without this, `COPY . .` in the builder stage overwrites the alpine-built node_modules with
|
||||
# the host's glibc one — better-sqlite3's compiled addon would then fail to load in the musl
|
||||
# runtime image. It also keeps files that should never ship out of the image.
|
||||
node_modules
|
||||
.next
|
||||
.git
|
||||
.idea
|
||||
|
||||
# Local database, generated config and secrets: the real database arrives via a volume.
|
||||
/data
|
||||
.env
|
||||
.env.local
|
||||
.env*.local
|
||||
*.db
|
||||
*.db-wal
|
||||
*.db-shm
|
||||
|
||||
# Prisma's generated TypeScript client is reproducible from prisma/schema.prisma.
|
||||
/lib/generated
|
||||
|
||||
Dockerfile
|
||||
docker-compose.yml
|
||||
README.md
|
||||
Reference in new issue
Block a user