migration-patterns

Generate Rails migrations with UUID primary keys and no foreign key constraints.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/hidalgofdz/prestamista --skill migration-patterns-hidalgofdz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration-patterns
Source: https://github.com/hidalgofdz/prestamista/tree/main/.claude/skills/migration-patterns
Command: npx skills add https://github.com/hidalgofdz/prestamista --skill migration-patterns-hidalgofdz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides Rails developers in creating clean, flexible database schemas that use UUIDs for primary keys and avoid foreign key constraints, enhancing modularity and migration ease.

Core Features & Use Cases

  • Migration Templates: Provides code patterns for creating tables, adding columns, and configuring indexes following best practices.
  • Schema Design Guidance: Helps architects set up multi-tenant schemas with UUIDs and explicit account scoping.
  • Use Case: When designing a multi-tenant app, generate migrations with UUID primary keys, account_id fields, and no foreign key dependencies to make data migrations safer and more adaptable.

Quick Start

Review the recommended migration patterns and generate migration files accordingly to conform to UUID usage and schema simplicity.

Frequently Asked Questions about migration-patterns

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

FAQPage Schema
How do I design a Rails multi-tenant database schema with UUIDs?

Design a Rails multi-tenant database schema with UUIDs by using UUID primary keys and explicit account_id scoping while avoiding foreign key constraints, ensuring modular data models and safer data migrations.

Why use UUIDs instead of foreign keys in Rails database migrations?

Using UUIDs instead of foreign keys in Rails migrations enhances schema simplicity and modularity, allowing flexible data migrations and avoiding restrictive dependencies in multi-tenant applications.

How do I generate reversible Rails migrations with no foreign key constraints?

Generate reversible Rails migrations without foreign key constraints by applying specific code patterns for creating tables, adding columns, and configuring indexes to enforce schema simplicity and modularity.

Can I use this UUID schema design approach for an existing Rails application?

Yes, you can use this UUID schema design approach for existing Rails applications by adopting the migration templates to transition primary keys, add account_id fields, and remove foreign key dependencies for safer data migrations.

What are the trade-offs of avoiding foreign key constraints in Rails?

Avoiding foreign key constraints in Rails trades strict referential integrity for easier data migrations, schema flexibility, and multi-tenant adaptability, requiring explicit application-level checks for data consistency.