Skip to main content

No project description provided

Project description

# FAQ Alembic Git Migration

> This module created as wrapper for Alembic and the main idea is
> attaching real git branch, monitoring heads and auto-recommendations
> for merging when developer creates new migration.

# How to install
pip install faq-migrations

# Add CLI to your project
> As standalone manager

from faq_migrations.cli import migrations

if __name__ == '__main__':

> As sub-group of click
import click
from faq_migrations.cli import migrations

cli = click.Group()

if __name__ == '__main__':

> and run cli

python migrations --help

# List of commands:
Usage: migrations [OPTIONS] COMMAND [ARGS]...

Creating of new migrations and upgrading database

--help Show this message and exit.

compare_history Compare local and remote history
create Create new migration for current branch
current Show current migration revision
heads Show current heads
history Show last migration, limit=20, upper=True
init Initialize new alembic directory
last_revision Show previous migration
merge Merge branches or heads
migrate Upgrade to head
upgrade_migrations Show not yet applied migrations

# Config settings
from faq_migrations.settings import config

# Path to your directory with alembic.ini
config.config_file_path = 'faq_migrations/migrations/'

# Path to templates directory with alembic.ini and mako files
config.template_path = 'faq_migrations/templates/'

# Default template name
config.template_name = 'git-generic'

# Path to your directory with migrations
config.alembic_dir = 'migrations/'

# You can setup database url in this param or in alembic.ini.
# This parameter has higher priority
config.database_url = 'driver://username:pass@host:port/db_name'
> Before initializing new directory with migrations you must setup config
> params.

# Building and Publication

### Build
python sdist
twine upload dist/*

### Publication
pip install twine
twine upload dist/*

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for faq-migrations, version 1.0.25
Filename, size File type Python version Upload date Hashes
Filename, size faq_migrations-1.0.25.tar.gz (10.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page