Remove migration code and alembic dependency
This commit is contained in:
@@ -13,7 +13,7 @@ This package provides persistent storage for anime series, episodes, download qu
|
||||
Install required dependencies:
|
||||
|
||||
```bash
|
||||
pip install sqlalchemy alembic aiosqlite
|
||||
pip install sqlalchemy aiosqlite
|
||||
```
|
||||
|
||||
Or use the project requirements:
|
||||
@@ -163,24 +163,6 @@ from src.config.settings import settings
|
||||
settings.database_url = "sqlite:///./data/aniworld.db"
|
||||
```
|
||||
|
||||
## Migrations (Future)
|
||||
|
||||
Alembic is installed for database migrations:
|
||||
|
||||
```bash
|
||||
# Initialize Alembic
|
||||
alembic init alembic
|
||||
|
||||
# Generate migration
|
||||
alembic revision --autogenerate -m "Description"
|
||||
|
||||
# Apply migrations
|
||||
alembic upgrade head
|
||||
|
||||
# Rollback
|
||||
alembic downgrade -1
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Run database tests:
|
||||
@@ -196,7 +178,6 @@ The test suite uses an in-memory SQLite database for isolation and speed.
|
||||
- **base.py**: Base declarative class and mixins
|
||||
- **models.py**: SQLAlchemy ORM models (4 models)
|
||||
- **connection.py**: Engine, session factory, dependency injection
|
||||
- **migrations.py**: Alembic migration placeholder
|
||||
- ****init**.py**: Package exports
|
||||
- **service.py**: Service layer with CRUD operations
|
||||
|
||||
@@ -432,5 +413,4 @@ Solution: Ensure referenced records exist before creating relationships.
|
||||
## Further Reading
|
||||
|
||||
- [SQLAlchemy 2.0 Documentation](https://docs.sqlalchemy.org/en/20/)
|
||||
- [Alembic Tutorial](https://alembic.sqlalchemy.org/en/latest/tutorial.html)
|
||||
- [FastAPI with Databases](https://fastapi.tiangolo.com/tutorial/sql-databases/)
|
||||
|
||||
@@ -313,7 +313,6 @@ async def get_schema_version(engine: Optional[AsyncEngine] = None) -> str:
|
||||
"""Get current database schema version.
|
||||
|
||||
Returns version string based on existing tables and structure.
|
||||
For production, consider using Alembic versioning.
|
||||
|
||||
Args:
|
||||
engine: Optional database engine (uses default if not provided)
|
||||
|
||||
Reference in New Issue
Block a user