{"id":13461697,"url":"https://github.com/sqlalchemy/alembic","last_synced_at":"2025-05-12T03:48:44.490Z","repository":{"id":37271625,"uuid":"159267771","full_name":"sqlalchemy/alembic","owner":"sqlalchemy","description":"A database migrations tool for SQLAlchemy.","archived":false,"fork":false,"pushed_at":"2025-05-08T13:01:23.000Z","size":4507,"stargazers_count":3280,"open_issues_count":121,"forks_count":269,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-05-08T14:21:21.081Z","etag":null,"topics":["python","sql","sqlalchemy"],"latest_commit_sha":null,"homepage":"","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/sqlalchemy.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"alembic","patreon":"zzzeek","tidelift":"pypi/SQLAlchemy"}},"created_at":"2018-11-27T03:02:53.000Z","updated_at":"2025-05-08T13:01:28.000Z","dependencies_parsed_at":"2023-10-14T17:42:47.858Z","dependency_job_id":"9a9c41f4-8e9c-4f60-81bc-b9f95b80d619","html_url":"https://github.com/sqlalchemy/alembic","commit_stats":{"total_commits":1624,"total_committers":194,"mean_commits":8.371134020618557,"dds":0.25,"last_synced_commit":"b6b44c1e90c96b55939b28d73f427eff7b9cb620"},"previous_names":[],"tags_count":129,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlalchemy%2Falembic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlalchemy%2Falembic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlalchemy%2Falembic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqlalchemy%2Falembic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqlalchemy","download_url":"https://codeload.github.com/sqlalchemy/alembic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672531,"owners_count":21945475,"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":["python","sql","sqlalchemy"],"created_at":"2024-07-31T11:00:52.960Z","updated_at":"2025-05-12T03:48:44.445Z","avatar_url":"https://github.com/sqlalchemy.png","language":"Python","readme":"Alembic is a database migrations tool written by the author\nof `SQLAlchemy \u003chttp://www.sqlalchemy.org\u003e`_.  A migrations tool\noffers the following functionality:\n\n* Can emit ALTER statements to a database in order to change\n  the structure of tables and other constructs\n* Provides a system whereby \"migration scripts\" may be constructed;\n  each script indicates a particular series of steps that can \"upgrade\" a\n  target database to a new version, and optionally a series of steps that can\n  \"downgrade\" similarly, doing the same steps in reverse.\n* Allows the scripts to execute in some sequential manner.\n\nThe goals of Alembic are:\n\n* Very open ended and transparent configuration and operation.   A new\n  Alembic environment is generated from a set of templates which is selected\n  among a set of options when setup first occurs. The templates then deposit a\n  series of scripts that define fully how database connectivity is established\n  and how migration scripts are invoked; the migration scripts themselves are\n  generated from a template within that series of scripts. The scripts can\n  then be further customized to define exactly how databases will be\n  interacted with and what structure new migration files should take.\n* Full support for transactional DDL.   The default scripts ensure that all\n  migrations occur within a transaction - for those databases which support\n  this (Postgresql, Microsoft SQL Server), migrations can be tested with no\n  need to manually undo changes upon failure.\n* Minimalist script construction.  Basic operations like renaming\n  tables/columns, adding/removing columns, changing column attributes can be\n  performed through one line commands like alter_column(), rename_table(),\n  add_constraint(). There is no need to recreate full SQLAlchemy Table\n  structures for simple operations like these - the functions themselves\n  generate minimalist schema structures behind the scenes to achieve the given\n  DDL sequence.\n* \"auto generation\" of migrations. While real world migrations are far more\n  complex than what can be automatically determined, Alembic can still\n  eliminate the initial grunt work in generating new migration directives\n  from an altered schema.  The ``--autogenerate`` feature will inspect the\n  current status of a database using SQLAlchemy's schema inspection\n  capabilities, compare it to the current state of the database model as\n  specified in Python, and generate a series of \"candidate\" migrations,\n  rendering them into a new migration script as Python directives. The\n  developer then edits the new file, adding additional directives and data\n  migrations as needed, to produce a finished migration. Table and column\n  level changes can be detected, with constraints and indexes to follow as\n  well.\n* Full support for migrations generated as SQL scripts.   Those of us who\n  work in corporate environments know that direct access to DDL commands on a\n  production database is a rare privilege, and DBAs want textual SQL scripts.\n  Alembic's usage model and commands are oriented towards being able to run a\n  series of migrations into a textual output file as easily as it runs them\n  directly to a database. Care must be taken in this mode to not invoke other\n  operations that rely upon in-memory SELECTs of rows - Alembic tries to\n  provide helper constructs like bulk_insert() to help with data-oriented\n  operations that are compatible with script-based DDL.\n* Non-linear, dependency-graph versioning.   Scripts are given UUID\n  identifiers similarly to a DVCS, and the linkage of one script to the next\n  is achieved via human-editable markers within the scripts themselves.\n  The structure of a set of migration files is considered as a\n  directed-acyclic graph, meaning any migration file can be dependent\n  on any other arbitrary set of migration files, or none at\n  all.  Through this open-ended system, migration files can be organized\n  into branches, multiple roots, and mergepoints, without restriction.\n  Commands are provided to produce new branches, roots, and merges of\n  branches automatically.\n* Provide a library of ALTER constructs that can be used by any SQLAlchemy\n  application. The DDL constructs build upon SQLAlchemy's own DDLElement base\n  and can be used standalone by any application or script.\n* At long last, bring SQLite and its inability to ALTER things into the fold,\n  but in such a way that SQLite's very special workflow needs are accommodated\n  in an explicit way that makes the most of a bad situation, through the\n  concept of a \"batch\" migration, where multiple changes to a table can\n  be batched together to form a series of instructions for a single, subsequent\n  \"move-and-copy\" workflow.   You can even use \"move-and-copy\" workflow for\n  other databases, if you want to recreate a table in the background\n  on a busy system.\n\nDocumentation and status of Alembic is at https://alembic.sqlalchemy.org/\n\nThe SQLAlchemy Project\n======================\n\nAlembic is part of the `SQLAlchemy Project \u003chttps://www.sqlalchemy.org\u003e`_ and\nadheres to the same standards and conventions as the core project.\n\nDevelopment / Bug reporting / Pull requests\n___________________________________________\n\nPlease refer to the\n`SQLAlchemy Community Guide \u003chttps://www.sqlalchemy.org/develop.html\u003e`_ for\nguidelines on coding and participating in this project.\n\nCode of Conduct\n_______________\n\nAbove all, SQLAlchemy places great emphasis on polite, thoughtful, and\nconstructive communication between users and developers.\nPlease see our current Code of Conduct at\n`Code of Conduct \u003chttps://www.sqlalchemy.org/codeofconduct.html\u003e`_.\n\nLicense\n=======\n\nAlembic is distributed under the `MIT license\n\u003chttps://opensource.org/licenses/MIT\u003e`_.\n","funding_links":["https://github.com/sponsors/alembic","https://patreon.com/zzzeek","https://tidelift.com/funding/github/pypi/SQLAlchemy"],"categories":["Python","Database Clients","Data Management \u0026 Processing"],"sub_categories":["Database \u0026 Cloud Management"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlalchemy%2Falembic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqlalchemy%2Falembic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqlalchemy%2Falembic/lists"}