Skip to content

MauriDev94/api-fast-api

Repository files navigation

To activate Python virtual environment

*windows bash

    venv/scripts/activate

Install Dependencies

    pip install -r requirements.txt

Run Postgres DB in Docker

  1. Run Postgres DB container
    docker-compose -f docker-compose-dev.yaml --env-file .env up -d

Run the application

    uvicorn app.main:app --reload

Alembic Command

  1. Initialize alembic
    alembic init alembic
  1. Create migration
    alembic revision --autogenerate -m "your message..."
  1. Update database
    alembic upgrade head
  1. This will undo the last migration
    alembic downgrade -1
  1. This will list all migration history(You can use this to find the migration to undo)
    alembic history --verbose
  1. Downgrade to specific revision
    alembic downgrade <revision ID>
  1. This will reset the database to the initial state
    alembic downgrade base

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published