{"id":20021334,"url":"https://github.com/pallets-eco/flask-alembic","last_synced_at":"2025-03-05T12:13:49.462Z","repository":{"id":71128729,"uuid":"203873363","full_name":"pallets-eco/flask-alembic","owner":"pallets-eco","description":"Integrate Alembic with Flask.","archived":false,"fork":false,"pushed_at":"2024-09-01T15:59:36.000Z","size":386,"stargazers_count":43,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-30T00:14:12.440Z","etag":null,"topics":["alembic","database","flask","flask-sqlalchemy","flask-sqlalchemy-lite","migrations","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://flask-alembic.readthedocs.io","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/pallets-eco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2019-08-22T21:06:00.000Z","updated_at":"2024-09-25T08:06:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"562a9e30-d942-4804-ae26-e0d06cc40d11","html_url":"https://github.com/pallets-eco/flask-alembic","commit_stats":null,"previous_names":["pallets-eco/flask-alembic","davidism/flask-alembic"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-alembic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-alembic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-alembic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pallets-eco%2Fflask-alembic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pallets-eco","download_url":"https://codeload.github.com/pallets-eco/flask-alembic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242023181,"owners_count":20059298,"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","database","flask","flask-sqlalchemy","flask-sqlalchemy-lite","migrations","python","sqlalchemy"],"created_at":"2024-11-13T08:36:21.072Z","updated_at":"2025-03-05T12:13:49.439Z","avatar_url":"https://github.com/pallets-eco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask-Alembic\n\nFlask-Alembic is a [Flask][] extension that provides a configurable [Alembic][]\ndatabase migration environment. Supports [Flask-SQLAlchemy],\n[Flask-SQLAlchemy-Lite], or plain [SQLAlchemy]. Supports Alembic's single and\nmultiple database templates.\n\n[Flask]: https://flask.palletsprojects.com\n[Alembic]: https://alembic.sqlalchemy.org\n[SQLAlchemy]: https://www.sqlalchemy.org\n[Flask-SQLAlchemy]: https://flask-sqlalchemy.palletsprojects.com\n[Flask-SQLAlchemy-Lite]: https://flask-sqlalchemy-lite.readthedocs.io\n\n## Pallets Community Ecosystem\n\n\u003e [!IMPORTANT]\\\n\u003e This project is part of the Pallets Community Ecosystem. Pallets is the open\n\u003e source organization that maintains Flask; Pallets-Eco enables community\n\u003e maintenance of Flask extensions. If you are interested in helping maintain\n\u003e this project, please reach out on [the Pallets Discord server][discord].\n\u003e\n\u003e [discord]: https://discord.gg/pallets\n\n## Basic Usage\n\nYou've created a Flask application and some models with Flask-SQLAlchemy. Now\nstart using Flask-Alembic:\n\n```python\nfrom flask_alembic import Alembic\n\n# Intialize the extension\nalembic = Alembic()\nalembic.init_app(app)\n```\n\nCommands are added to the `flask` CLI:\n\n```text\n$ flask db --help\n$ flask db revision \"making changes\"\n$ flask db upgrade\n```\n\nYou can also access Alembic's functionality from Python:\n\n```python\nwith app.app_context():\n    # Auto-generate a migration\n    alembic.revision('making changes')\n\n    # Upgrade the database\n    alembic.upgrade()\n\n    # Access the internals\n    environment_context = alembic.env\n```\n\n## Differences from Alembic\n\n- Configuration is taken from `Flask.config` instead of `alembic.ini` and\n  `env.py`.\n- Engines and model/table metadata are taken from Flask-SQLAlchemy(-Lite) if\n  available, or can be configured manually.\n- The migrations are stored directly in the `migrations` folder instead of the\n  `versions` folder.\n- Provides the migration environment instead of `env.py` and exposes Alembic's\n  internal API objects.\n- Differentiates between CLI commands and Python functions. The functions return\n  revision objects and don't print to stdout.\n- Allows operating Alembic at any API level while the app is running, through\n  the exposed objects and functions.\n- Adds a system for managing independent migration branches and makes it easier\n  to work with named branches.\n- Does not (currently) support offline migrations. I don't plan to work on this\n  but am open to patches.\n- Does not (currently) support async engines. I don't plan to work on this but\n  am open to patches.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-alembic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpallets-eco%2Fflask-alembic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpallets-eco%2Fflask-alembic/lists"}