Resets staging database with full schema drop. Use for schema changes or migrations. SINGLE SOURCE OF TRUTH for staging database reset automation.
Drops all tables in the staging database to rebuild schema from migrations. Use after deploying schema changes to staging when migrations conflict with existing tables.
/plugin marketplace add DarkMonkDev/WitchCityRope/plugin install darkmonkdev-witchcityrope-agents@DarkMonkDev/WitchCityRopeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Purpose: Full database reset for staging environment - drops all tables and lets migrations rebuild.
When to Use:
When NOT to Use:
Background Documentation: See /docs/guides-setup/database-setup.md (Staging Database Management section) for context and manual procedures.
This skill performs DESTRUCTIVE operations:
pgbouncer-staging)Note: DigitalOcean managed databases don't allow dropping the public schema (owned by doadmin). This skill drops all tables owned by witchcity_staging user instead.
Prerequisites:
staging-deploy skill first)Executable Script: execute.sh
# From project root - with confirmation prompt
bash .claude/skills/database-reset-staging/execute.sh
# Skip confirmation prompt (for automation)
SKIP_CONFIRMATION=true bash .claude/skills/database-reset-staging/execute.sh
What the script does:
.env.staging)witchcity_staging user (CASCADE)Script includes CRITICAL safety warnings - this is a DESTRUCTIVE operation that cannot be undone.
If skill fails, manual steps:
Prerequisites: Get DB credentials from server first
ssh witchcity@104.131.165.14 'cat /opt/witchcityrope/staging/.env.staging | grep STAGING_DB_CONNECTION_STRING'
Manual table drop: Connect to database and execute:
-- Generate DROP statements for all tables owned by witchcity_staging
SELECT 'DROP TABLE IF EXISTS "' || tablename || '" CASCADE;'
FROM pg_tables
WHERE schemaname = 'public' AND tableowner = 'witchcity_staging';
-- Then execute the generated statements
Then: Restart staging containers via SSH:
ssh witchcity@104.131.165.14 'cd /opt/witchcityrope/staging && docker compose -f docker-compose.staging.yml up -d --force-recreate api'
Cause: PostgreSQL client not installed locally
Solution:
# Ubuntu/Debian
sudo apt install postgresql-client
# macOS
brew install postgresql
Cause: Firewall or network issue
Solution:
ssh witchcity@104.131.165.14restart-dev-containers skillCause: Old migration state or code/DB mismatch
Solution:
restart-dev-containers skillstaging-deploy skillCause: Seed condition not met
Solution:
appsettings.Staging.json has SeedData: truerestart-dev-containers skillTypical workflow:
staging-deploy skillrestart-dev-containers skill to check logswitchcity_staging user cannot drop public schema (owned by doadmin)witchcity_staging with CASCADEdocs/functional-areas/deployment/staging-deployment-guide.mddocs/guides-setup/database-setup.mdRemember: This skill is for staging only. Never use on production. Always use staging-deploy skill first to ensure latest code is deployed.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.