diff --git a/server/migrate.ts b/server/migrate.ts index 8a1ff19..d2110d3 100644 --- a/server/migrate.ts +++ b/server/migrate.ts @@ -5,7 +5,7 @@ export async function migrate() { try { console.log("[Migration] Starting safe migration Check..."); - // 1. Create Enums if not exist + // 1. Create Enums if not exist and Update Enums await client.query(` DO $$ BEGIN CREATE TYPE "token_status" AS ENUM('valid', 'expiring', 'expired', 'error'); @@ -14,6 +14,9 @@ export async function migrate() { END $$; `); + // Add 'reel' to post_type enum if not exists + await client.query(`ALTER TYPE "post_type" ADD VALUE IF NOT EXISTS 'reel';`); + // 2. Create Tables if not exist // post_analytics