diff options
Diffstat (limited to 'databases/drizzle/.claude')
| -rw-r--r-- | databases/drizzle/.claude/commands/migrate.md | 23 | ||||
| -rw-r--r-- | databases/drizzle/.claude/commands/schema.md | 18 | ||||
| -rw-r--r-- | databases/drizzle/.claude/settings.json | 47 |
3 files changed, 88 insertions, 0 deletions
diff --git a/databases/drizzle/.claude/commands/migrate.md b/databases/drizzle/.claude/commands/migrate.md new file mode 100644 index 0000000..0c7a06f --- /dev/null +++ b/databases/drizzle/.claude/commands/migrate.md @@ -0,0 +1,23 @@ +--- +description: Handle Drizzle migrations (generate, push, rollback) +argument-hint: "[generate|push|rollback|status]" +allowed-tools: Bash, Read, Write +--- + +Handle Drizzle migrations: $ARGUMENTS + +Available actions: + +- **generate** - Generate migration from schema changes +- **push** - Push schema changes to database +- **rollback** - Rollback last migration +- **status** - Check migration status + +Steps: + +1. Check current migration status +2. Execute the requested migration action +3. Verify the operation completed successfully +4. Show resulting database state + +Always backup production data before running migrations. diff --git a/databases/drizzle/.claude/commands/schema.md b/databases/drizzle/.claude/commands/schema.md new file mode 100644 index 0000000..c038b06 --- /dev/null +++ b/databases/drizzle/.claude/commands/schema.md @@ -0,0 +1,18 @@ +--- +description: Generate type-safe Drizzle schema for a table +argument-hint: "[table-name] [database-type]" +allowed-tools: Write, Read, Edit +--- + +Generate a complete Drizzle ORM schema for the table "$ARGUMENTS". + +Follow these requirements: + +1. Use proper TypeScript types and imports +2. Include appropriate indexes for performance +3. Add relationships if referenced tables exist +4. Include proper constraints and validations +5. Generate both insert and select type exports +6. Follow Drizzle naming conventions + +If no table name is provided, show available schema patterns and examples. diff --git a/databases/drizzle/.claude/settings.json b/databases/drizzle/.claude/settings.json new file mode 100644 index 0000000..f471570 --- /dev/null +++ b/databases/drizzle/.claude/settings.json @@ -0,0 +1,47 @@ +{ + "permissions": { + "allow": [ + "Bash(npm run db:*)", + "Bash(npx drizzle-kit:*)", + "Bash(npm run migrate:*)", + "Bash(npm run seed:*)", + "Write(drizzle/**/*)", + "Write(src/schema/**/*)", + "Write(src/lib/db.ts)", + "Read(drizzle.config.ts)", + "Read(package.json)" + ], + "deny": [ + "Read(.env.production)", + "Read(.env.local)", + "Write(.env)", + "Bash(npm publish:*)", + "Bash(rm -rf:*)" + ] + }, + "env": { + "NODE_ENV": "development" + }, + "hooks": { + "PostToolUse": [ + { + "matcher": "Write", + "hooks": [ + { + "type": "command", + "command": "npx prettier --write $FILE_PATH", + "timeout": 10 + } + ] + } + ] + }, + "_metadata": { + "name": "Drizzle ORM", + "version": "1.0.0", + "category": "database", + "generated": "2025-08-20T13:36:56.490Z", + "generator": "manual", + "note": "Official Claude Code configuration" + } +} |
