{"id":49016068,"url":"https://github.com/bhuvaneswaranmurugesan/alembic-sqlalchemy-mssql-setup","last_synced_at":"2026-04-19T02:02:19.341Z","repository":{"id":323212532,"uuid":"1092490027","full_name":"BhuvaneswaranMurugesan/alembic-sqlalchemy-mssql-setup","owner":"BhuvaneswaranMurugesan","description":"Step-by-step setup of Alembic and SQLAlchemy with MS SQL Server - demonstrating database version control, environment-based configurations, and migration workflows.","archived":false,"fork":false,"pushed_at":"2025-11-08T19:00:27.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-08T20:27:42.167Z","etag":null,"topics":["alembic","database","database-migrations","learning-by-doing","mssql","orm","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BhuvaneswaranMurugesan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-08T18:10:58.000Z","updated_at":"2025-11-08T19:00:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/BhuvaneswaranMurugesan/alembic-sqlalchemy-mssql-setup","commit_stats":null,"previous_names":["bhuvaneswaranmurugesan/alembic-sqlalchemy-mssql-setup"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/BhuvaneswaranMurugesan/alembic-sqlalchemy-mssql-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BhuvaneswaranMurugesan%2Falembic-sqlalchemy-mssql-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BhuvaneswaranMurugesan%2Falembic-sqlalchemy-mssql-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BhuvaneswaranMurugesan%2Falembic-sqlalchemy-mssql-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BhuvaneswaranMurugesan%2Falembic-sqlalchemy-mssql-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BhuvaneswaranMurugesan","download_url":"https://codeload.github.com/BhuvaneswaranMurugesan/alembic-sqlalchemy-mssql-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BhuvaneswaranMurugesan%2Falembic-sqlalchemy-mssql-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31991720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","database","database-migrations","learning-by-doing","mssql","orm","python","sqlalchemy"],"created_at":"2026-04-19T02:02:16.738Z","updated_at":"2026-04-19T02:02:19.336Z","avatar_url":"https://github.com/BhuvaneswaranMurugesan.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# alembic-sqlalchemy-mssql-setup\n\n🧩 Alembic + SQLAlchemy + MS SQL Setup\n\nThis repository demonstrates how to set up Alembic with SQLAlchemy for Microsoft SQL Server (MS SQL) to manage database schema migrations efficiently and securely.\n\n📖 What is Alembic?\n\nAlembic is a lightweight database migration tool used with SQLAlchemy.\nIt lets you version control your database schema — just like Git does for your code.\n\nWhenever your models change, Alembic tracks those changes and generates migration scripts that can upgrade or downgrade your database automatically.\n\n🔹 Why We Use Alembic\n\n- Keeps schema in sync across development, staging, and production.\n\n- Avoids manual SQL ALTER statements.\n\n- Works seamlessly with SQLAlchemy models.\n\n- Enables rollback in case of issues.\n\n- Easy to integrate in CI/CD pipelines.\n\n⚙️ Advantages\n\n✅ Tracks schema changes automatically.\n✅ Version control for database structure.\n✅ Safe rollbacks using downgrade commands.\n✅ Works with many databases (Postgres, MySQL, MS SQL, etc.)\n\n⚠️ Disadvantages\n\n❌ Requires careful merge handling when multiple developers create migrations at once.\n❌ Must ensure models are imported correctly into Alembic’s env.py\n\n🧠 What is SQLAlchemy?\n\nSQLAlchemy is a powerful Python ORM (Object-Relational Mapper).\nIt lets you define your database tables and relationships in Python classes instead of raw SQL.\n\nAlembic depends on SQLAlchemy to read these models and detect changes.\n\n🔹 Role of SQLAlchemy in this Setup\n\n- Defines tables using Python classes (Base, Column, Integer, String, etc.).\n\n- Provides Base.metadata that Alembic uses for autogeneration.\n\n- Creates the engine connection to MS SQL.\n\n- Simplifies queries and database interactions.\n\n🧰 Project Structure\nalembic-sqlalchemy-mssql-setup/\n```\n│\n├── alembic/                 # Migration scripts \u0026 env configuration\n│   ├── versions/            # Auto-generated migration files\n│   └── env.py               # Alembic environment setup\n│\n├── app/\n│   ├── core/\n│   │   └── database.py      # SQLAlchemy engine \u0026 Base setup\n│   └── models/\n│       └── user.py          # Example SQLAlchemy model\n│\n├── .env                     # Database URL (ignored in Git)\n├── alembic.ini              # Alembic config file\n├── README.md\n└── requirements.txt\n```\n### Note : The required packages and migration commands are provided in the migration-setup-alembic folder.\n\n### 💡 Author\nCreated with ❤️ by [Bhuvaneswaran Murugesan](https://www.linkedin.com/in/bhuvaneswaranmurugesan/)\n\n📧 Email: bhuvaneshabi.5@gmail.com  \n🌐 GitHub: [BhuvaneswaranMurugesan](https://github.com/BhuvaneswaranMurugesan)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhuvaneswaranmurugesan%2Falembic-sqlalchemy-mssql-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbhuvaneswaranmurugesan%2Falembic-sqlalchemy-mssql-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbhuvaneswaranmurugesan%2Falembic-sqlalchemy-mssql-setup/lists"}