anitnilay20 / anitnilay20/beatrix
Add PostgreSQL migration system
- Dominant language
- Rust
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Implement a migration system for PostgreSQL to handle schema changes, version control, and database evolution.
## Requirements
- [ ] Create migration framework
- [ ] Support CREATE/ALTER/DROP TABLE operations
- [ ] Add migration versioning
- [ ] Implement rollback functionality
- [ ] Add CLI tools for migration management
- [ ] Write comprehensive tests
## Acceptance Criteria
- Users can create migrations: `beatrix migrate create add_user_table`
- Support for up/down migrations
- Track migration history in database
- Generate migrations from model changes
## Files to create
- `beatrix_cli/` (new crate)
- `beatrix_core/src/relational/migrations/`
- `beatrix_macro/src/migrations.rs`
## Example Usage
```rust
// CLI usage
beatrix migrate create add_users_table
beatrix migrate up
beatrix migrate down
// In code
Migration::new("add_users_table")
.create_table("users", |table| {
table.id();
table.string("name");
table.string("email").unique();
})
.run(&db).await?;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.