File Naming Convention
Migration filenames must follow this structure:- Version (required) - Must begin with a number, optional
vorVprefix - Double underscore (
__) separator - Description - Human-readable description using underscores or hyphens
- Suffix (optional) - Migration type indicator
.sqlfile extension
Version Formats
Choose a versioning strategy that fits your team:- Timestamp
- Semantic
- Sequential
Timestamp-Based - Recommended for teams with parallel developmentFormat:
YYYYMMDDHHmmss✅ No merge conflicts
✅ Chronological ordering
✅ Supports distributed teams⚠️ Less human-readableChange Type Suffixes
Specify the migration type using an optional suffix:| Suffix | Type | Description | Use Cases |
|---|---|---|---|
| (none) | DDL | Data Definition Language | CREATE, ALTER, DROP tables, indexes, constraints |
_dml | DML | Data Manipulation Language | INSERT, UPDATE, DELETE, data migrations |
_ghost | Ghost | gh-ost online migration | Zero-downtime MySQL schema changes |
Online Schema Migration
Learn about gh-ost for zero-downtime MySQL migrations

