with one click
db-smoke-test
Run post-migration validation checks
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Run post-migration validation checks
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Execute story development with selectable automation modes to accommodate different developer preferences, skill levels, and story complexity.
Set up a Kord-aligned documentation baseline (no legacy frameworks)
Create Next Story Task methodology and workflow
Validate Next Story Task methodology and workflow
advanced-elicitation methodology and workflow
No checklists needed - this task facilitates brainstorming sessions, validation is through user interaction methodology and workflow
| name | db-smoke-test |
| description | Run post-migration validation checks |
| agent | architect |
| subtask | false |
Run post-migration validation checks
Parameter:* mode (optional, default: interactive)
Purpose:* Definitive pass/fail criteria for task completion
Checklist:*
acceptance-criteria:
- [ ] Data persisted correctly; constraints respected; no orphaned data
type: acceptance-criterion
blocker: true
validation: |
Assert data persisted correctly; constraints respected; no orphaned data
error_message: "Acceptance criterion not met: Data persisted correctly; constraints respected; no orphaned data"
Strategy:* retry
Common Errors:*
Error:* Connection Failed
Error:* Query Syntax Error
Error:* Transaction Rollback
Check for smoke test in this order:
supabase/tests/smoke/v_current.sql (project-specific)supabase/tests/smoke_test.sql (project-specific)tmpl-smoke-test.sql (template)SMOKE_TEST=""
if [ -f "supabase/tests/smoke/v_current.sql" ]; then
SMOKE_TEST="supabase/tests/smoke/v_current.sql"
elif [ -f "supabase/tests/smoke_test.sql" ]; then
SMOKE_TEST="supabase/tests/smoke_test.sql"
elif [ -f "tmpl-smoke-test.sql" ]; then
SMOKE_TEST="tmpl-smoke-test.sql"
else
echo "❌ No smoke test file found"
exit 1
fi
echo "Running smoke test: $SMOKE_TEST"
psql "$SUPABASE_DB_URL" -v ON_ERROR_STOP=1 -f "$SMOKE_TEST"
If successful:*
✅ Smoke Test Passed
Checks completed:
✓ Table count validation
✓ Policy count validation
✓ Function existence checks
✓ Basic query sanity
If failed:*
❌ Smoke Test Failed
Review errors above and:
1. Check migration completeness
2. Verify RLS policies installed
3. Confirm functions created
4. Consider rollback if critical
Basic smoke tests typically check:
Create supabase/tests/smoke/v_X_Y_Z.sql:
-- Smoke Test for v1.2.0
SET client_min_messages = warning;
-- Table count
SELECT COUNT(*) AS tables FROM information_schema.tables
WHERE table_schema='public';
-- Expected: 15
-- RLS enabled
SELECT tablename FROM pg_tables
WHERE schemaname='public' AND rowsecurity = false;
-- Expected: empty (all tables have RLS)
-- Critical functions exist
SELECT proname FROM pg_proc
WHERE pronamespace = 'public'::regnamespace
AND proname IN ('function1', 'function2');
-- Expected: 2 rows
-- Sample data query
SELECT COUNT(*) FROM users WHERE deleted_at IS NULL;
-- Expected: > 0
-- RLS sanity (doesn't error)
SET LOCAL request.jwt.claims = '{"sub":"00000000-0000-0000-0000-000000000000","role":"authenticated"}';
SELECT 1 FROM protected_table LIMIT 1;
✓ Migration validated
→ Update migration log
→ Run RLS audit: rls-audit
→ Check performance: analyze-hotpaths
❌ Migration issues detected
→ Review errors
→ Consider rollback: rollback {snapshot}
→ Fix migration
→ Retry