CREATE TYPE "SocialPostMediaProcessingStatus" AS ENUM ('PROCESSING', 'READY', 'FAILED');

ALTER TABLE "social_post_media"
  ADD COLUMN "cover_storage_key" TEXT,
  ADD COLUMN "processing_status" "SocialPostMediaProcessingStatus" NOT NULL DEFAULT 'READY',
  ADD COLUMN "processing_error" VARCHAR(500),
  ADD COLUMN "processed_at" TIMESTAMPTZ(3);

CREATE UNIQUE INDEX "social_post_media_cover_storage_key_key"
  ON "social_post_media"("cover_storage_key");
