{"id":18141347,"url":"https://github.com/rustamovakrom/fastapi_sqlalchemy_alembic","last_synced_at":"2026-05-03T15:33:05.974Z","repository":{"id":260641387,"uuid":"881913067","full_name":"RustamovAkrom/FastAPI_SQLAlchemy_Alembic","owner":"RustamovAkrom","description":"✅FastAPI, SQLAlchemy, Alembic integrations project","archived":false,"fork":false,"pushed_at":"2024-11-01T18:09:01.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T00:28:37.267Z","etag":null,"topics":["alembic","fastapi","fastapi-sqlalchemy","python"],"latest_commit_sha":null,"homepage":"https://rustamovakrom.github.io/FastAPI_SQLAlchemy_Alembic/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RustamovAkrom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["RustamovAkrom"],"patreon":"AkromRustamov","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"akromjonru1","thanks_dev":"rustamovakrom","custom":null}},"created_at":"2024-11-01T13:42:30.000Z","updated_at":"2024-11-15T10:18:23.000Z","dependencies_parsed_at":"2024-11-01T15:22:12.876Z","dependency_job_id":"4a41a6a9-d3e6-45c9-af56-2ef192a19ca2","html_url":"https://github.com/RustamovAkrom/FastAPI_SQLAlchemy_Alembic","commit_stats":null,"previous_names":["rustamovakrom/fastapi_sqlalchemy_alembic"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustamovAkrom%2FFastAPI_SQLAlchemy_Alembic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustamovAkrom%2FFastAPI_SQLAlchemy_Alembic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustamovAkrom%2FFastAPI_SQLAlchemy_Alembic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustamovAkrom%2FFastAPI_SQLAlchemy_Alembic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RustamovAkrom","download_url":"https://codeload.github.com/RustamovAkrom/FastAPI_SQLAlchemy_Alembic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247528758,"owners_count":20953479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alembic","fastapi","fastapi-sqlalchemy","python"],"created_at":"2024-11-01T17:06:27.760Z","updated_at":"2026-05-03T15:33:05.898Z","avatar_url":"https://github.com/RustamovAkrom.png","language":"Python","funding_links":["https://github.com/sponsors/RustamovAkrom","https://patreon.com/AkromRustamov","https://buymeacoffee.com/akromjonru1","https://thanks.dev/rustamovakrom"],"categories":[],"sub_categories":[],"readme":"# FastAPI SQLAlchemy MIgrations Guide\n\n### Step 1: Getting Up the Enviroment\n```\nmkdir app\ncd app\n```\n**Now, create a virtual enviroment to isolate our project dependencies:**\n```sh\npython -m venv venv\nsource venv/bin/activate # On Windows, use \"venv\\Scripts\\activate\"\n```\n### Step 2: Installing Required Packages\n```txt\npip install fastapi[all] uvicorn[standart] sqlalchemy alembic\n```\n### Step 3: Creating the database\n**How that we have defined our model, let`s create the SQLite database and tables**\n```sh\nalembic init alembic\n```\n### Step 3: Auto Migration\nif you alembic handles migrations follow this method: In the alembic folder edit env.py and find target_metadata line and edit like the following\n```py\n# alembic/env.py\n\n# NOTE we addedd\nfrom app.db.base import Base\ntarget_metadata = Base.metadata\n```\n### Step 5: Configuring Alembic\n**Open the alembic.ini file in the alembic directory and make the following changes:**\n```ini\n# alembic.ini\n[alembic]\nscript_location = alembic\n\nsqlalchmey.url = sqlite:///./sqlite3.db # Replace with your database URL if different\n```\n### Step 6: Generating a Migration\n```sh\nalembic revision --autogenerate -m \"Initial migration\"\n```\n### Step 7: Applying the Migration\n```sh\nalembic upgrade head\n```\n### Step 8: Run project\n```sh\npython main.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustamovakrom%2Ffastapi_sqlalchemy_alembic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustamovakrom%2Ffastapi_sqlalchemy_alembic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustamovakrom%2Ffastapi_sqlalchemy_alembic/lists"}