database-schema

Manage database schema evolution with Drizzle ORM migrations for PostgreSQL and SQLite.

Updated Sep 21, 2025
One-click install
npx skills add https://github.com/hmjn023/solid-imager --skill database-schema-hmjn023
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-schema
Source: https://github.com/hmjn023/solid-imager/tree/main/.opencode/skills/database-schema
Command: npx skills add https://github.com/hmjn023/solid-imager --skill database-schema-hmjn023

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defines and migrates database schemas using Drizzle ORM to keep application models and database structures in sync, with repeatable migrations and safer deployments.

Core Features & Use Cases

  • Define schema changes in apps/server/src/infrastructure/db/schema.ts and generate corresponding migration files with bun db:generate.
  • Apply migrations using bun db:migrate or db:migrate:pglite for different backends.
  • Verify and inspect database state with migrations and studio tooling like db:studio.

Quick Start

Edit apps/server/src/infrastructure/db/schema.ts to reflect the desired changes, then generate and apply migrations using bun --filter @solid-imager/server db:generate followed by bun --filter @solid-imager/server db:migrate.

Frequently Asked Questions about database-schema

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

FAQPage Schema
How do I generate database migrations using Drizzle ORM and Bun?

To generate database migrations using Drizzle ORM and Bun, edit your schema.ts file to define changes, then run bun db:generate to create migration files ensuring application models and database structures stay synchronized.

What is code-defined schema evolution for PostgreSQL and SQLite?

Code-defined schema evolution manages database structure changes through a version-controlled schema.ts file, enabling repeatable migrations and safer deployments across PostgreSQL or SQLite backends using Drizzle ORM.

Can I apply Drizzle ORM migrations to both PostgreSQL and SQLite backends?

Yes, you can apply Drizzle ORM migrations to different backends by running bun db:migrate for standard PostgreSQL or SQLite deployments, and db:migrate:pglite specifically for PGLite environments.

How do I inspect database state after running Drizzle ORM migrations?

You can inspect database state after running Drizzle ORM migrations by using the db:studio command, which provides a visual interface to verify that your database structure matches your defined application models.

Why should I use code-defined schema changes instead of manual database edits?

Code-defined schema changes ensure parity between application models and the database by versioning edits in schema.ts, generating repeatable migrations, and preventing structural drift during deployments across PostgreSQL and SQLite environments.