Model and Migration Skill

Create and manage Lucid ORM models with Knex migrations in TypeScript.

3|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/necessarylion/bun-starter-kit --skill model-and-migration-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Model and Migration Skill
Source: https://github.com/necessarylion/bun-starter-kit/tree/main/.claude/model-and-migration
Command: npx skills add https://github.com/necessarylion/bun-starter-kit --skill model-and-migration-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guides developers through building robust data layers by defining models and migrations using Lucid ORM and Knex, aligning database schemas with application code.

Core Features & Use Cases

  • Model creation: define models with decorators and relationships consistent with the database.
  • Migration workflows: create, run, rollback, and manage migrations with Knex, ensuring schema versioning.
  • End-to-end patterns: demonstrates integration between app query layer (Lucid) and migrations (Knex) for reliable data access.

Quick Start

Create a migration and a corresponding model for a products table, then run migrations and query the table.

Frequently Asked Questions about Model and Migration Skill

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

FAQPage Schema
How do I create database models and migrations using Lucid ORM and Knex?

To create database models and migrations using Lucid ORM and Knex, you define TypeScript models with decorators and relationships, then manage schema versioning with Knex up/down migration patterns for synchronized data access.

What is the best way to keep database schemas synchronized with application code in Node.js?

Keeping database schemas synchronized with application code in Node.js requires defining Lucid ORM models alongside Knex migration workflows, ensuring reliable schema versioning and consistent data query patterns across environments.

Do I need a TypeScript project configured with Lucid ORM to use Knex migrations?

Yes, you need a TypeScript project configured with Lucid ORM and Knex migrations to use this workflow, as it relies on TypeScript decorators and Lucid model definitions to demonstrate integration with Knex schema changes.

Can I manage schema rollback patterns with Knex while querying data with Lucid?

Yes, you can manage schema rollback patterns with Knex while querying data with Lucid, because this workflow demonstrates end-to-end integration between the application query layer and reliable Knex migration history.

How does Lucid ORM handle relationships when defining models for a Knex migration?

Lucid ORM handles relationships by using TypeScript decorators in model definitions that align with the database schema created by Knex migrations, ensuring consistent data access and reliable query layer integration.