migration

Review Vikunja database migrations for cross-DB safety and error handling.

5.0k|597|Updated Nov 28, 2018
One-click install
npx skills add https://github.com/go-vikunja/vikunja --skill migration-go-vikunja
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration
Source: https://github.com/go-vikunja/vikunja/tree/main/.claude/skills/migration
Command: npx skills add https://github.com/go-vikunja/vikunja --skill migration-go-vikunja

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps prevent broken or unsafe Vikunja database migrations by guiding developers to write cross-DB, production-safe migration code that handles errors correctly and avoids schema/data inconsistencies.

Core Features & Use Cases

  • Cross-DB migration correctness (MySQL/PostgreSQL/SQLite): Ensures the same migration logic works reliably across the three supported databases.
  • DDL error handling discipline: Forces handling of errors from tx.Exec, session.Exec, and xorm calls so migrations do not falsely appear successful.
  • Time-column and schema consistency: Enforces time.Time for time fields and requires struct and frontend model sync after schema changes.
  • Safety for path/user input: Requires sanitizing any user-supplied paths or archive entry names to prevent traversal and misuse.
  • Validation via feature tests: Directs using mage test:feature (SQLite default) to catch schema/behavior mismatches after changes.

Quick Start

Ask the AI to review or generate a new Vikunja migration for your struct change, ensuring cross-DB compatibility, strict error handling, correct time field usage, and updated frontend model types.

Frequently Asked Questions about migration

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

FAQPage Schema
How do I write database migrations that work safely across MySQL, PostgreSQL, and SQLite?

Database migrations across MySQL, PostgreSQL, and SQLite require strict error handling for all DDL execution and explicit cross-DB type-safety considerations to prevent silent failures and schema inconsistencies.

Why do my database migrations falsely appear successful when DDL changes fail?

Migrations falsely appear successful when errors from tx.Exec, session.Exec, and xorm calls go unhandled. Enforcing strict DDL error handling discipline catches these execution failures and prevents false success reports.

What is the correct way to handle time columns and schema consistency during migration?

Time-column updates require enforcing time.Time for time fields and synchronizing struct and frontend models after schema changes to maintain consistency across the application layer.

How do I sanitize user-supplied paths in import data to prevent directory traversal?

Sanitizing user-supplied paths and archive entry names in migration logic prevents directory traversal and misuse. This safety measure is required when import data touches user-supplied file paths.

Does mage test:feature catch schema and behavior mismatches after database migration changes?

Running mage test:feature with SQLite as the default database validates schema and behavior consistency after migration changes, catching cross-DB mismatches before deployment.

What are the limitations of running cross-DB schema evolution without explicit type-safety checks?

Cross-DB schema evolution without explicit type-safety considerations risks broken migrations and data inconsistencies across MySQL, PostgreSQL, and SQLite due to differing native type behaviors and DDL execution rules.