# Manage Supabase Database Changes

Database changes can cause data loss, slow queries, or access-control errors. This skill provides structured guidance for CookMode V2 schemas, migrations, RLS, and Supabase troubleshooting.

## Install

```bash
npx skillstore add adamfehse/database-manager
```

## Metadata

- Status: approved
- Slug: adamfehse-database-manager
- Skillstore revision: r2
- Version status: missing
- Tree hash: e940943ef24e0803050aade940511b34b3b2483a001e74ce4eaa871fd9addb83
- Author: AdamFehse
- GitHub username: AdamFehse
- License: MIT
- Repository: https://github.com/AdamFehse/cookmodeV2/tree/main/.claude/skills/database-manager
- Ref: 80999bf530a7874d7bedf8ce202001ecb4c4f5e0
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/adamfehse-database-manager
- Manifest: https://skillstore.pages.dev/api/skills/adamfehse-database-manager/manifest

## Capabilities

- Documents the five CookMode V2 Supabase tables and their primary purposes.
- Provides SQL examples for creating tables, indexes, columns, and constraints.
- Guides migration naming, local testing, and manual rollback documentation.
- Explains Supabase client queries, upserts, deletes, and real-time subscriptions.
- Lists troubleshooting steps for synchronization, constraints, and RLS errors.

## Use Cases

- Add a recipe feature: Plan a table, indexes, migration, and application updates for a new recipe capability.
- Resolve database errors: Work through constraint, synchronization, and RLS troubleshooting steps for CookMode V2.
- Review data access: Assess existing Supabase policies and replace permissive rules with scoped access controls.

## Prompt Templates

### List relevant tables

```
Which CookMode V2 tables relate to recipe completion, and what does each table store?
```

### Plan a migration

```
Help me plan a migration that adds a priority field to recipe_status. Include validation and rollback notes.
```

### Troubleshoot synchronization

```
Recipe updates are not syncing between clients. Give me a step-by-step Supabase troubleshooting checklist.
```

### Design secure RLS

```
Design least-privilege RLS policies for recipe_notes in a multi-tenant Supabase application. Include separate read, insert, update, and delete rules.
```

## Limitations

- It documents a specific CookMode V2 schema and may not match another project.
- It does not execute migrations or inspect a live database.
- Its permissive RLS examples are unsuitable for untrusted or multi-tenant deployments.
- It does not replace backups, migration review, or production testing.

## Best Practices

- Test every migration locally with realistic data before deployment.
- Back up data and document a rollback path before destructive changes.
- Use least-privilege RLS policies with explicit tenant or user checks.

## Anti Patterns

- Do not use unrestricted RLS policies in untrusted or multi-tenant applications.
- Do not modify production schema manually without a reviewed migration.
- Do not drop tables or columns without a verified backup and recovery plan.

## Security Audit

- Audited at: 2026-07-18T09:59:03.911\+00:00
- Summary: All 40 static findings are false positives caused by Markdown backticks and SQL examples, not shell execution or reconnaissance. However, the documented Row Level Security policies permit unrestricted reads and writes and are unsafe for untrusted or multi-tenant deployments.

## Stats

- Views: 254
- Downloads: 9
- Favorites: 0
- Popularity score: 0
