giuseppe-trisciuoglio/developer-kit / plugins/developer-kit-typescript/skills/nestjs
nestjs
VerifiedProvides comprehensive NestJS framework patterns with Drizzle ORM integration for building scalable server-side applications. Generates REST/GraphQL APIs, implements authentication guards, creates database schemas, and sets up microservices. Use when building NestJS applications, setting up APIs, implementing authentication, working with databases, or integrating Drizzle ORM.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.6 KB |
| references/best-practices.md | markdown | 1.4 KB |
| references/drizzle-reference.md | markdown | 51.2 KB |
| references/migrations.md | markdown | 1.1 KB |
| references/patterns.md | markdown | 11.2 KB |
| references/reference.md | markdown | 32.9 KB |
| references/testing.md | markdown | 3.4 KB |
| references/workflow-optimization.md | markdown | 6.0 KB |
references/migrations.md
View on GitHub# Drizzle Migrations
Database migration patterns for NestJS with Drizzle ORM.
## Generating Migrations
```bash
npx drizzle-kit generate
```
## Running Migrations
```typescript
// src/migrations/migration.service.ts
import { Injectable } from '@nestjs/common';
import { migrate } from 'drizzle-orm/node-postgres/migrator';
import { DatabaseService } from '../db/database.service';
@Injectable()
export class MigrationService {
constructor(private db: DatabaseService) {}
async runMigrations() {
try {
await migrate(this.db.database, { migrationsFolder: './drizzle' });
console.log('Migrations completed successfully');
} catch (error) {
console.error('Migration failed:', error);
throw error;
}
}
}
```
## Migration Best Practices
1. **Always backup before migrating** - Protect production data
2. **Test migrations locally first** - Catch issues early
3. **Make migrations reversible** - Use `down` migrations when possible
4. **Keep migrations small** - Easier to debug and rollback
5. **Version control migrations** - Track schema changes in git
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |