- Add connection pool configuration (pool_size, max_overflow, timeout, recycle) - Add transaction management utilities (transaction, savepoint, retry_on_deadlock) - Create repository pattern classes for all entities (Project, Package, Artifact, Tag, Upload) - Implement ref_count decrement and cleanup service - Add query helper functions (search, filtering, pagination, stats) - Add database constraints (check_ref_count_non_negative, check_size_positive) - Add performance indexes (idx_artifacts_ref_count, composite indexes for packages/tags) - Initialize Alembic migrations for future schema changes
28 lines
709 B
Plaintext
28 lines
709 B
Plaintext
Alembic Migrations for Orchard
|
|
|
|
This directory contains database migration scripts managed by Alembic.
|
|
|
|
Common Commands:
|
|
# Generate a new migration (autogenerate from model changes)
|
|
alembic revision --autogenerate -m "description of changes"
|
|
|
|
# Apply all pending migrations
|
|
alembic upgrade head
|
|
|
|
# Rollback one migration
|
|
alembic downgrade -1
|
|
|
|
# Show current migration status
|
|
alembic current
|
|
|
|
# Show migration history
|
|
alembic history
|
|
|
|
# Generate SQL without applying (for review)
|
|
alembic upgrade head --sql
|
|
|
|
Notes:
|
|
- Always review autogenerated migrations before applying
|
|
- Test migrations in development before applying to production
|
|
- Migrations are stored in the versions/ directory
|