-- Migration: 006_widen_support_code.sql
-- Purpose: v2 Task 4 — widen the support-code column to hold the new
--          higher-entropy human-readable code.
--
-- v1 generated a 6-digit numeric code; the column was VARCHAR(10) (001). Task 4
-- replaces it with a grouped base32-style code `XXX-XXX-XXX` (9 symbols + 2
-- hyphens = 11 chars), which does NOT fit in VARCHAR(10). Widen to TEXT so the
-- column can hold the new code (and any future longer format) without truncation.
--
-- connect_sessions.support_code (also VARCHAR(10) in 001) stores the same value
-- on a support session record, so it is widened too.
--
-- Idempotent: ALTER ... TYPE TEXT is a no-op if the column is already TEXT.
-- Applied on server startup by sqlx::migrate!(); never pre-applied via psql.
-- See .claude/standards/gururmm/sqlx-migrations.md.

ALTER TABLE connect_support_codes
    ALTER COLUMN code TYPE TEXT;

ALTER TABLE connect_sessions
    ALTER COLUMN support_code TYPE TEXT;
