Database Implementation

Design SQL database schemas and migrations with Flyway and Exposed ORM.

Updated Dec 22, 2025
One-click install
npx skills add https://github.com/Angriff36/task-orchestrator --skill database-implementation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Database Implementation
Source: https://github.com/Angriff36/task-orchestrator/tree/main/claude-plugins/task-orchestrator/skills/database-implementation
Command: npx skills add https://github.com/Angriff36/task-orchestrator --skill database-implementation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides database schema design, migrations, and data modeling to ensure scalable, reliable data systems with good performance and maintainable migration strategies.

Core Features & Use Cases

  • Migration Patterns: Versioned migrations for tables, columns, indexes, and constraints.
  • ORM Modeling: Mapping entities to tables and defining relationships.
  • Performance & Validation: Indexing, query optimization, and rollback strategies.

Quick Start

  1. Create migrations (V001+, e.g., table creation)
  2. Run migrations: ./gradlew flywayMigrate
  3. Validate and rollback as needed: flywayInfo, flywayClean

Frequently Asked Questions about Database Implementation

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

FAQPage Schema
How do I design database migrations with Flyway and SQL?

Database migrations with Flyway use versioned SQL files (V001, V002, etc.) to version schema changes. Write migration scripts for table creation, columns, and constraints, then execute via ./gradlew flywayMigrate. Flyway tracks applied migrations and prevents re-execution, ensuring repeatable, reliable schema evolution.

What's the best way to handle database rollbacks and validation?

Use flywayInfo to inspect migration history and status, and flywayClean to reset for testing. Plan rollback strategies within your migration scripts—undo procedures or separate rollback migrations. Test migrations in isolated environments before applying to production to guarantee success.

How do I map ORM entities to database tables and define relationships?

ORM mapping with frameworks like Exposed connects entity classes to relational tables through schema definitions and foreign keys. Define relationships (one-to-many, many-to-many) using junction tables and constraints. Pair ORM mappings with indexed columns and query optimization for maintainable, performant data models.

Can I use indexing and constraints to improve database query performance?

Indexing creates fast lookup paths on frequently queried columns; constraints enforce data integrity. Add indexes to foreign keys, primary keys, and search filters within migrations. Query optimization techniques combined with proper indexing reduce scan time and improve application responsiveness across large datasets.

Does Flyway work with relational databases for schema seeding and testing?

Flyway executes SQL migrations on relational databases to create schemas, seed test data, and manage constraints. Each versioned migration is idempotent and repeatable, making it ideal for test environments. Combine migrations with rollback strategies to validate schema changes before production deployment.

Related Skills