gerardpaligot/confily/exposed-migration
Claude Code and agent skill by gerardpaligot/confily
- community
Checking that the SKILL.md file is still in the repository.
Use this skill when adding, removing, or modifying columns, indexes, or tables in any Exposed table object (files under infrastructure/exposed/ ending in Table.kt). Explains when a migration is required, how to create one following the project convention, and how to register it so it runs automatically at startup.
Install
npx vskill@latest install gerardpaligot/confily/exposed-migrationSKILL.md
Exposed Migration Skill
When a Migration Is Required
A migration must be created whenever you change an Exposed table definition in a way that alters the existing database schema. SchemaUtils.create() only creates tables that do not exist yet — it never modifies existing ones.
| Change | Migration needed? | |
|---|---|---|
Add a new Table object | No — SchemaUtils.create() handles it | |
| Add a column to an existing table | Yes | |
| Remove a column from an existing table | Yes (manual ALTER TABLE DROP COLUMN) | |
| Change a column type or constraint | Yes | |
| Add or remove an index on an existing table | Yes | |
| Rename a column | Yes | |
| Add a new nullable column with a default | Yes |
If you skip the migration, the new column/index will exist in code but not in the production database, causing runtime crashes on the next deployment.
Project Infrastructure
The migration system lives at:
DatabaseFactory.init() calls MigrationManager(MigrationRegistry.allMigrations).migrate(database) after SchemaUtils.create(). Each migration is run exactly once: its id is written to schema_migrations on success and skipped on all subsequent startups.
How to Create a Migration
1. Create the migration class
Add a new file in versions/ named after what the migration does:
2. Register it in MigrationRegistry
Open MigrationRegistry.kt and append the new migration at the end of allMigrations:
Do not reorder existing entries — migrations are applied in list order and each runs only once.
ID Convention
Use YYYYMMDD_short_snake_case_description, e.g.:
20260326_add_activities_external_provider20260401_add_partner_video_url
The id must be unique across all migrations and sortable chronologically. The MigrationManager sorts by id before applying, so the date prefix guarantees correct ordering.
Patterns for Common Changes
Add nullable columns to an existing table
Just add the column to the table object and call SchemaUtils.createMissingTablesAndColumns:
Execute raw SQL (e.g. drop a column, add a partial index)
Use exec() inside a Transaction:
up() is always called inside an active transaction (from MigrationManager), so exec() is available directly.
Data migration
Perform data manipulation with Exposed DSL inside up():
Rules
- Never modify an already-applied migration. Once an
idis inschema_migrations, that migration will never run again. Fix mistakes with a new migration. - Never reorder `MigrationRegistry.allMigrations`. The list order controls application order for new databases.
- Keep `up()` idempotent where possible. Use
IF NOT EXISTS,IF EXISTS, andcreateMissingTablesAndColumnsso re-runs on a partially migrated database are safe. - One logical change per migration. Small, focused migrations are easier to debug and roll forward.
- Always provide a meaningful `description`. It appears in logs and
schema_migrationsfor auditability.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/exposed-migration/SKILL.md
Popularity
- Repository stars
- 152
- Repository forks
- 9
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gerardpaligot/confily/exposed-migration)