This project contain a basic implementation using SQLAlchemy and Alembic
This project uses poetry for environment managing and some libraries for code formatting
poetry add SQLAlchemy
poetry add alembic
- Initilizing alembic
# inside the project folder, run the following code
alembic init alembic
- Configuring alembic database url
# update the file project/alembic/env.py adding the following code before the functions
config.set_main_option('sqlalchemy.url', os.environ.get('DATABASE_URL'))
# creating migration
alembic revision --autogenerate -m "Initial migration"
# executing migrations
alembic upgrade head
# inside the poetry environment, run the following code
task test