fix: add missing migration for viewCount, downloadCount, isPublished, publishedAt, imageUrl
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -55,14 +55,5 @@ EXPOSE 3000
|
|||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
# Run migrations with retry logic and start server
|
# Simple startup: try migration once then start (migration errors won't prevent startup)
|
||||||
CMD sh -c '\
|
CMD sh -c "echo 'Waiting 10s for database...' && sleep 10 && echo 'Running migrations...' && prisma migrate deploy --schema=./prisma/schema.prisma || echo 'Migration failed, continuing anyway...' && echo 'Starting server...' && exec node server.js"
|
||||||
echo "Waiting for database..." && \
|
|
||||||
sleep 5 && \
|
|
||||||
echo "Running migrations..." && \
|
|
||||||
for i in 1 2 3 4 5; do \
|
|
||||||
prisma migrate deploy --schema=./prisma/schema.prisma && break || \
|
|
||||||
(echo "Migration failed, retrying in 5s..." && sleep 5); \
|
|
||||||
done && \
|
|
||||||
echo "Starting server..." && \
|
|
||||||
node server.js'
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- AlterTable - Add missing columns to Document
|
||||||
|
ALTER TABLE "Document" ADD COLUMN IF NOT EXISTS "viewCount" INTEGER NOT NULL DEFAULT 0;
|
||||||
|
ALTER TABLE "Document" ADD COLUMN IF NOT EXISTS "downloadCount" INTEGER NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
-- AlterTable - Add missing columns to Folder
|
||||||
|
ALTER TABLE "Folder" ADD COLUMN IF NOT EXISTS "isPublished" BOOLEAN NOT NULL DEFAULT false;
|
||||||
|
ALTER TABLE "Folder" ADD COLUMN IF NOT EXISTS "publishedAt" TIMESTAMP(3);
|
||||||
|
ALTER TABLE "Folder" ADD COLUMN IF NOT EXISTS "imageUrl" TEXT;
|
||||||
Reference in New Issue
Block a user