Migrate video metadata to PostgreSQL for improved data management

Introduces a new video migration service to transfer video metadata from Bunny.net to PostgreSQL. Updates storage logic to prioritize PostgreSQL, removes redundant fields from the video schema, and adds database migration functionality to the server startup.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d7424866-83d1-4486-a212-ac12b4c7becf
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/d7424866-83d1-4486-a212-ac12b4c7becf/i1Fg8VZ
This commit is contained in:
sebastjanartic
2025-08-28 17:23:05 +00:00
parent 443d92804e
commit f658b64b56
4 changed files with 99 additions and 26 deletions
+7
View File
@@ -41,6 +41,13 @@ app.use((req, res, next) => {
// Initialize video sync service for automatic Bunny.net updates
await videoSyncService.initialize();
// Run video metadata migration on startup
const { videoMigrator } = await import('./videoMigrator');
console.log("🔄 Starting video metadata migration to PostgreSQL...");
videoMigrator.migrateAllVideoMetadata().catch(error => {
console.error("❌ Video migration failed:", error);
});
const server = await registerRoutes(app);
app.use((err: any, _req: Request, res: Response, _next: NextFunction) => {