You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the database and type foundation for Content Studio Instagram feed publishing. This establishes instagram_feed as a first-class Content Variant format and creates the publish account/job persistence needed by later publish service work.
This task must not add UI behavior, generation behavior, publish request/response DTOs, Next route schemas, publishJobsByVariantId, or Meta API calls.
Acceptance criteria
content_variants.format accepts instagram_feed through the primary Supabase SQL migration.
content_publish_accounts and content_publish_jobs exist with indexes and admin-only RLS policies matching content_packets / content_variants.
The latest-job index supports deterministic ordering with (variant_id, created_at DESC, id DESC).
content_publish_jobs.status allows only queued, processing, published, and failed; no uploading state.
The migration is idempotent and updates the existing format constraint safely by confirming the current constraint name, then using DROP CONSTRAINT IF EXISTS <current_name> and ADD CONSTRAINT with that name.
Publish job FKs preserve audit history: variant_id and account_id are ON DELETE RESTRICT, requested_by is ON DELETE SET NULL, and account disablement uses status = 'disabled'.
content_publish_accounts.created_by is nullable for env-backed lazy-upserted accounts; content_publish_jobs.requested_by records the publish-requesting admin.
content_publish_jobs stores both platform and format with MVP-narrow CHECK constraints.
SeaORM migration/entities are added only as Rust/prod parity with the Supabase SQL schema.
Web/Rust DB types are limited to foundation types: Supabase table types, instagram_feed format acceptance, SeaORM publish account/job entities, and entity exports.
Publish DTOs, publishJobsByVariantId, Next route schemas, UI state, and generation defaults/templates/prompts are left to later tasks.
Migration verification is documented in the PR, including whether supabase db reset or direct migration apply against LOCAL_DATABASE_URL was run, plus the TypeScript/Rust compile or focused test result.
Parent
Parent: #593
What to build
Add the database and type foundation for Content Studio Instagram feed publishing. This establishes
instagram_feedas a first-class Content Variant format and creates the publish account/job persistence needed by later publish service work.This task must not add UI behavior, generation behavior, publish request/response DTOs, Next route schemas,
publishJobsByVariantId, or Meta API calls.Acceptance criteria
content_variants.formatacceptsinstagram_feedthrough the primary Supabase SQL migration.content_publish_accountsandcontent_publish_jobsexist with indexes and admin-only RLS policies matchingcontent_packets/content_variants.(variant_id, created_at DESC, id DESC).content_publish_jobs.statusallows onlyqueued,processing,published, andfailed; nouploadingstate.DROP CONSTRAINT IF EXISTS <current_name>andADD CONSTRAINTwith that name.variant_idandaccount_idareON DELETE RESTRICT,requested_byisON DELETE SET NULL, and account disablement usesstatus = 'disabled'.content_publish_accounts.created_byis nullable for env-backed lazy-upserted accounts;content_publish_jobs.requested_byrecords the publish-requesting admin.content_publish_jobsstores bothplatformandformatwith MVP-narrow CHECK constraints.instagram_feedformat acceptance, SeaORM publish account/job entities, and entity exports.publishJobsByVariantId, Next route schemas, UI state, and generation defaults/templates/prompts are left to later tasks.supabase db resetor direct migration apply againstLOCAL_DATABASE_URLwas run, plus the TypeScript/Rust compile or focused test result.Blocked by
None - can start immediately.