Flask extension for working with Alembic
Project description
Flask-DbMigrant
Flask extension for working with Alembic.
It can be used as an alternative for Flask-Migrate. It depends only on Flask and Alembic.
Installation
$ pip install Flask-DbMigrant
Usage
First create the dbmigrant
object:
from flask_dbmigrant import DbMigrant
dbmigrant = DbMigrant()
Then initialize it using init_app method:
dbmigrant.init_app(app) # app is your Flask app instance
The Flask app config should have DB_MODULE
and DATABASE_URL
keys.
DB_MODULE
is a name of the module from which database models and metadata are to be imported.
DATABASE_URL
is a connection string that tells what database to connect to.
Existing commands
-
flask db init
create a migration repository and configure the environment
-
flask db migrate
create a migration script
-
flask db upgrade
execute the script
License
Flask-DbMigrant
was created by Rafal Padkowski. It is licensed under the terms
of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for flask_dbmigrant-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ffacddba4fb55763f4f9898f3a84204550210b137ef6b4af7b91a5d68c52091 |
|
MD5 | 5216131a6afb41a9a5898d61ca0de843 |
|
BLAKE2b-256 | c6538ea8d05fcb7cb8769042c3e75c231f27969fc06abc8661eb086c24d42925 |