fix: pinned posts not sorted to top + compose pulls GHCR image

- posts API: ORDER BY is_pinned DESC, pinned_at DESC NULLS LAST before
  sort (matches upstream) — pinned posts now appear first
- docker-compose: app service pulls ghcr.io/lezi-fun/forumlify-deploy:next
  instead of local build (auto-rebuilt on push)
This commit is contained in:
lezi-fun committed 2026-08-11 18:55:10 +08:00
1 parent d265caa5bf
commit 7c6b816ac7
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ export async function GET(req) {
FROM posts p FROM posts p
JOIN users u ON p.user_id = u.id JOIN users u ON p.user_id = u.id
${where} ${where}
ORDER BY ${sort} DESC ORDER BY is_pinned DESC, pinned_at DESC NULLS LAST, ${sort} DESC
LIMIT $${(await params).length + 1} OFFSET $${(await params).length + 2} LIMIT $${(await params).length + 1} OFFSET $${(await params).length + 2}
`, [...params, limit, offset]); `, [...params, limit, offset]);
+3 -1
View File
@@ -13,7 +13,8 @@ services:
- "5432:5432" - "5432:5432"
app: app:
build: . # 从 GHCR 拉取镜像(每次 push next 自动重建),不再本地构建
image: ghcr.io/lezi-fun/forumlify-deploy:next
ports: ports:
- "3000:3000" - "3000:3000"
depends_on: depends_on:
@@ -24,6 +25,7 @@ services:
PORT: 3000 PORT: 3000
volumes: volumes:
- ./uploads:/app/uploads - ./uploads:/app/uploads
restart: unless-stopped
volumes: volumes:
db_data: db_data: