aff23d931a
Make task_run_v2 a faithful (non-degraded) clone of TaskRun and make the v2 cutover safe to actually enable: - Add the INCLUDE (id) WITH (fillfactor=90) covering clause to task_run_v2's (runtimeEnvironmentId, createdAt DESC) index so the dashboard run-list query keeps index-only scans, matching TaskRun. Columns were already identical; v2 now has every index TaskRun has (plus a (createdAt, id) keyset index it needs for the cross-table cursor merge). - Reject enabling runTableV2 for an org unless realtimeBackend is "native" (validateFeatureFlagInvariants), wired into both admin feature-flag write routes. A v2 run minted while the org is still on Electric is realtime invisible, so block the bad combination at write time, not just at read time. - Add a guard test that fails CI if a generated migration re-adds an incoming foreign key to TaskRun (after the decoupling drop) or adds one referencing task_run_v2: the Prisma drift footgun that would re-couple the tables or break cross-table run creation.