data-model-design

Design tenant-scoped data models and migration lifecycles for Open Mercato modules.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/dominikpalatynski/test-ready-app --skill data-model-design-dominikpalatynski
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-model-design
Source: https://github.com/dominikpalatynski/test-ready-app/tree/main/.ai/skills/data-model-design
Command: npx skills add https://github.com/dominikpalatynski/test-ready-app --skill data-model-design-dominikpalatynski

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Designing scalable, well-structured data models and robust migration lifecycles for multi-tenant applications to prevent schema drift and upgrade risks. The approach follows Open Mercato conventions to plan entities, define fields, choose relationship patterns, add cross-module references, and manage database migrations across releases.

Core Features & Use Cases

  • Design Workflow: guided steps from clarifying entities and relationships to generating migrations and validating outputs.
  • Entity Design & Field Typing: templates and recommended field types to ensure consistency and type safety across modules.
  • Migration Lifecycle: safe patterns for evolving schemas, including adding, renaming, or deprecating columns with audit trails.
  • Cross-Module References: model relationships within a module and reference external modules via IDs, supplemented by enrichers for data retrieval.
  • Best Practices: soft deletes, data integrity, and non-cross-module ORM relationships aligned with modular boundaries.
  • Real-World Use Case: plan a new multi-tenant data model for a suite of interrelated modules.

Quick Start

Define your tenant-scoped entities and relationships, specify fields and keys, then follow the migration workflow to generate and apply migrations.

Frequently Asked Questions about data-model-design

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

FAQPage Schema
How do I design a data model for multi-tenant applications?

To design a data model for multi-tenant applications, define your tenant-scoped entities and relationships, specify recommended field types, then follow a migration workflow to generate and apply safe schema changes across releases.

What is the best way to manage cross-module references in an ORM?

The best way to manage cross-module references in an ORM is to model relationships within a module and reference external modules via IDs. You should use enrichers for data retrieval to maintain strict modular boundaries and avoid direct cross-module ORM relationships.

How do I plan safe database migrations for evolving schemas?

You can plan safe database migrations for evolving schemas by following a structured migration lifecycle. This includes using safe patterns for adding, renaming, or deprecating columns while maintaining audit trails to ensure data integrity during releases.

Does this data model design approach support soft deletes and type safety?

Yes, this data model design approach supports soft deletes and type safety. It provides templates and recommended field types to ensure consistency, while enforcing best practices for data integrity across interrelated modules.

When do I need to use a migration lifecycle for entity design?

You need to use a migration lifecycle for entity design when evolving schemas in multi-tenant applications to prevent schema drift. It becomes essential when adding, renaming, or deprecating columns with audit trails across module releases.