diff --git a/README.md b/README.md index 753df40..9840a96 100644 --- a/README.md +++ b/README.md @@ -136,21 +136,19 @@ This project uses Alembic for database migrations. Follow the steps below to gen ### Prerequisites -- Ensure you have Alembic installed in your Python environment. You can install it using pip: +- Ensure your database is running. If you're using Docker, you can start the database with: ```bash - pip install alembic ``` - -- Make sure your database is running. If you're using Docker, you can start the database with: - ```bash - docker-compose -f .docker/postgres-compose.yaml up -d ``` + docker-compose -f .docker/postgres-compose.yaml up -d + ``` ### Running Migrations -1. **Configure Alembic**: Ensure that the `alembic/env.py` file is correctly set up to connect to your database. This involves setting the SQLAlchemy URL in the `alembic.ini` file. +1. **Configure Alembic**: Ensure that the `alembic/env.py` file is correctly set up to connect to your database. The connection settings are managed through environment variables in your `.env` file. 2. **Create a New Migration**: To create a new migration script, run the following command: ```bash - alembic revision --autogenerate -m "Description of changes" ``` + alembic revision --autogenerate -m "Description of changes" + ``` This will generate a new migration script in the `alembic/versions` directory. @@ -158,7 +156,8 @@ This project uses Alembic for database migrations. Follow the steps below to gen 4. **Apply the Migration**: To apply the migration to the database, run: ```bash - alembic upgrade head ``` + alembic upgrade head + ``` This command will apply all pending migrations up to the latest one. @@ -166,7 +165,7 @@ This project uses Alembic for database migrations. Follow the steps below to gen ### Troubleshooting -- If you encounter any issues, ensure that your database connection settings in `alembic.ini` are correct. +- If you encounter any issues, ensure that your database connection settings in the `.env` file are correct. - Check the Alembic logs for any error messages that might indicate what went wrong. For more detailed information on using Alembic, refer to the [Alembic documentation](https://alembic.sqlalchemy.org/en/latest/).