Skip to content

Commit 9e667a7

Browse files
abrookinsclaude
andcommitted
Remove test migration file and update docs
- Remove placeholder dm1.py migration file that shouldn't be committed - Update migrations.md to clarify migrate vs om migrate differences - Document deprecation of standalone migrate command 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9662cda commit 9e667a7

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

docs/migrations.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ Redis OM provides two CLI interfaces:
1111

1212
### Unified CLI (Recommended)
1313
```bash
14-
om migrate # Schema migrations
14+
om migrate # File-based schema migrations with rollback support
1515
om migrate-data # Data migrations
1616
```
1717

18-
### Individual Commands (Backward Compatible)
18+
### Legacy Command (Deprecated)
1919
```bash
20-
migrate # Schema migrations (original command still works)
20+
migrate # Automatic schema migrations (deprecated - use om migrate)
2121
```
2222

23+
⚠️ **Important**: The standalone `migrate` command uses automatic migrations (immediate DROP+CREATE) and is deprecated. Use `om migrate` for the new file-based migration system with rollback support.
24+
2325
## Schema Migrations
2426

2527
Schema migrations manage RediSearch index definitions. When you change field types, indexing options, or other schema properties, Redis OM automatically detects these changes and can update your indices accordingly.
@@ -51,9 +53,25 @@ om migrate run
5153
om migrate run --migrations-dir myapp/schema-migrations
5254
```
5355

54-
> **Note**: The original `migrate` command is still available for backward compatibility.
56+
> **Note**: The legacy `migrate` command performs automatic migrations without file tracking and is deprecated. Use `om migrate` for production deployments.
57+
58+
### Migration Approaches
59+
60+
Redis OM provides two approaches to schema migrations:
61+
62+
#### File-based Migrations (`om migrate`) - Recommended
63+
- **Controlled**: Migrations are saved as versioned files
64+
- **Rollback**: Previous schemas can be restored
65+
- **Team-friendly**: Migration files can be committed to git
66+
- **Production-safe**: Explicit migration approval workflow
67+
68+
#### Automatic Migrations (`migrate`) - Deprecated
69+
- **Immediate**: Detects and applies changes instantly
70+
- **No rollback**: Cannot undo schema changes
71+
- **Development-only**: Suitable for rapid prototyping
72+
- **⚠️ Deprecated**: Use `om migrate` for production
5573

56-
### How Schema Migration Works
74+
### How File-based Migration Works
5775

5876
1. **Detection**: Auto-migrator detects index changes from your models
5977
2. **Snapshot**: `om migrate create` writes a migration file capturing old/new index schemas

0 commit comments

Comments
 (0)