diff --git a/Dockerfile b/Dockerfile index 2d920df..888d178 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,7 @@ RUN apk add --no-cache ffmpeg tzdata python3 py3-pip && \ COPY --from=builder --chown=node:node /app/build ./build COPY --from=builder --chown=node:node /app/node_modules ./node_modules COPY --from=builder --chown=node:node /app/package.json ./ +COPY --from=builder --chown=node:node /app/scripts ./scripts USER node diff --git a/scripts/migrate.js b/scripts/migrate.js new file mode 100644 index 0000000..d1a5988 --- /dev/null +++ b/scripts/migrate.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +/** + * Database migration script. + * For this SQLite project, schema creation is idempotent and happens on handler load. + * This script ensures the schema is initialized by importing the handler. + */ + +import('../build/handler.js') + .then(() => { + console.log('✓ Database schema initialized'); + process.exit(0); + }) + .catch((err) => { + console.error('✗ Failed to initialize database:', err.message); + process.exit(1); + }); diff --git a/src/tests/job-progress.test.ts b/src/tests/job-progress.test.ts index 0df7394..b9f6ad3 100644 --- a/src/tests/job-progress.test.ts +++ b/src/tests/job-progress.test.ts @@ -15,6 +15,8 @@ function makeJob(overrides: Partial = {}): Job { outputDir: null, segmentsJson: null, error: null, + retryCount: null, + nextRetryAt: null, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), ...overrides