wasp-database

Automate database migrations and schema management for Wasp projects.

2|1|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ToonVos/empty-opensaas --skill wasp-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wasp-database
Source: https://github.com/ToonVos/empty-opensaas/tree/main/.claude/skills/wasp-database
Command: npx skills add https://github.com/ToonVos/empty-opensaas --skill wasp-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the complex process of managing database schema changes and migrations in Wasp projects. It prevents common errors, ensures type safety, and simplifies database setup, saving developers from frustrating data sync issues.

Core Features & Use Cases

  • Guided Migration Workflow: Provides a step-by-step process for modifying schema.prisma, running migrations, and ensuring Wasp types are updated.
  • PostgreSQL Integration: Guides on setting up and using PostgreSQL, which is essential for advanced Wasp features like enums and background jobs.
  • Error Prevention: Highlights critical rules like mandatory restarts and correct migration commands, preventing common "types not updating" or "database out of sync" errors.
  • Use Case: Add a new status field with an enum type to your Task model in schema.prisma. This Skill will guide you through running the migration, ensuring your database is updated, and that your Wasp application's types correctly reflect the new schema.

Quick Start

Add a new status field with an enum type to the Task model in schema.prisma. Generate and apply the migration, then restart Wasp.

Frequently Asked Questions about wasp-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run database migrations in a Wasp project?

Database migrations in Wasp are run using the `wasp db migrate-dev` command, which applies schema changes defined in `schema.prisma` to your PostgreSQL database. After migration completes, restart Wasp with safe-start to regenerate types and sync your application.

What's the correct workflow for adding fields to my Wasp database schema?

Edit your `schema.prisma` file to add the new field, run `wasp db migrate-dev` to generate and apply the migration, then restart Wasp. This ensures your database, migration files, and application types stay synchronized and reflect your schema changes.

Why do I need to restart Wasp after running a migration?

Restarting Wasp after migration regenerates your application's type definitions to match the updated database schema. This prevents type mismatches and ensures your Wasp types accurately reflect changes like new enum fields or model updates.

Can I use SQLite with Wasp, or do I need PostgreSQL?

Wasp requires PostgreSQL for advanced features like enums and background jobs managed by PgBoss. While basic schemas may work with other databases, PostgreSQL is mandatory to access Wasp's full capabilities and ensure migration reliability.

What happens if I manually edit Wasp migration files?

Migration files in Wasp are immutable and should never be manually edited. Modifying them breaks the migration history and causes database synchronization failures. Always use `wasp db migrate-dev` to generate migrations automatically from your schema changes.

How do I add enum types to my Wasp database models?

Define enum types in your `schema.prisma` file and add enum fields to your models. Run `wasp db migrate-dev` to create the PostgreSQL enum and apply the schema change, then restart Wasp to update your application types with the new enum.