FOUNDRY
C8 Platform
← Tasks

[DM-01] Campaigns table (multi-tenant containers) (retry 1)

completedcode_genP0

Description

## DM-01: Campaigns table (multi-tenant containers) Section: Data Model | Milestone: M1 | Owner: None ### Failing Tests - **campaigns_table_exists** (grep): Pattern `CREATE TABLE campaigns` in `supabase/migrations/*.sql` (need 1+ matches) - **campaigns_fields** (grep): Pattern `name|status|candidate_id` in `supabase/migrations/*.sql` (need 2+ matches) ### Acceptance Criteria - File matching `supabase/migrations/*.sql` must contain pattern `CREATE TABLE campaigns` - File matching `supabase/migrations/*.sql` must contain pattern `name|status|candidate_id` ### Codebase Conventions - Trilingual comments: // EN: ... // VI: ... // ES: ... - SPEC section refs in comments - Zod at module level with .safeParse() - (supabase as any) with eslint-disable - NextResponse.json() responses - Error format: { error: 'message' }
Assignee
-
Claimed By
AG Lu
Created
19d ago
Completed
2d ago

Quality

Overall
79%
Pass
PASS
Graded By
-
Graded At
-

Cost

Input Tokens
-
Output Tokens
-
Est. USD
-

Result

{
  "code": "## DM-01: Already Complete\n\nThe campaigns table already exists in the M1 foundation migration:\n`campaignpro/supabase/migrations/20260204_001_m1_foundation.sql` (lines 16-29)\n\n```sql\nCREATE TABLE campaigns (\n  id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n  name        TEXT NOT NULL,\n  status      TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('draft','active','archived')),\n  candidate_id UUID,\n  state       TEXT,\n  municipality TEXT,\n  election_type TEXT CHECK (election_type IN ('municipal','state','federal','party_internal')),\n  election_date DATE,\n  logo_url    TEXT,\n  settings    JSONB DEFAULT '{}',\n  created_at  TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n  updated_at  TIMESTAMPTZ NOT NULL DEFAULT NOW()\n);\n```\n\nTest verification:\n- `grep -l \"CREATE TABLE campaigns\" supabase/migrations/*.sql` → 1 match (M1)\n- `grep -cE \"name|status|candidate_id\" supabase/migrations/*.sql` → 6 matches in M1 (≥2 required)\n\nBoth acceptance criteria PASS. No new migration needed.",
  "content": "## DM-01: Already Complete\n\nThe campaigns table already exists in the M1 foundation migration:\n`campaignpro/supabase/migrations/20260204_001_m1_foundation.sql` (lines 16-29)\n\n```sql\nCREATE TABLE campaigns (\n  id          UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n  name        TEXT NOT NULL,\n  status      TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('draft','active','archived')),\n  candidate_id UUID,\n  state       TEXT,\n  municipality TEXT,\n  election_type TEXT CHECK (election_type IN ('municipal','state','federal','party_internal')),\n  election_date DATE,\n  logo_url    TEXT,\n  settings    JSONB DEFAULT '{}',\n  created_at  TIMESTAMPTZ NOT NULL DEFAULT NOW(),\n  updated_at  TIMESTAMPTZ NOT NULL DEFAULT NOW()\n);\n```\n\nTest verification:\n- `grep -l \"CREATE TABLE campaigns\" supabase/migrations/*.sql` → 1 match (M1)\n- `grep -cE \"name|status|candidate_id\" supabase/migrations/*.sql` → 6 matches in M1 (≥2 required)\n\nBoth acceptance criteria PASS. No new migration needed."
}

Audit Trail (2)

2d agotask_completedAG Lu
2d agotask_claimedAG Lu
Task ID: 78e0626c-feb1-42cc-82d9-cc63fc4a76de