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.
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 DATABASE_URL
key. That 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
The app package should contain models.py file.
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
flask_dbmigrant-0.1.0.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for flask_dbmigrant-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfce73ac8357ce271d36393ca4b9d003cfcf291d46b7136e4bca90926d905975 |
|
MD5 | 331c6bd379a7864af130900a80f1cb56 |
|
BLAKE2b-256 | 4d3cbc53fbe54cc50f8decd98ee7de9ab2cddc44af81d0df055fb5a560a58e0b |