> 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
```bash
pip install faq-migrations
```
# Add CLI to your project
> As standalone manager
```python
from faq_migrations.cli import migrations
if __name__ == '__main__':
migrations()
```
> As sub-group of click
```python
import click
from faq_migrations.cli import migrations
cli = click.Group()
cli.add_command(migrations)
if __name__ == '__main__':
cli()
```
> and run cli
```bash
python your_manager.py migrations --help
```
# List of commands:
```
Usage: manager.py migrations [OPTIONS] COMMAND [ARGS]...
Creating of new migrations and upgrading database
Options:
--help Show this message and exit.
Commands:
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
```python
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
```bash
python setup.py sdist
twine upload dist/*
```
### Publication
```bash
pip install twine
twine upload dist/*
```
Metadata
Release files for faq-migrations 1.0.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| faq_migrations-1.0.25.tar.gz | 10.6 kB | Without provenance | Details for faq_migrations-1.0.25.tar.gz |
Release files / faq_migrations-1.0.25.tar.gz
| Download URL | faq_migrations-1.0.25.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0b4262c6bf99e9fac1b027d2a9e00acd8ebbf3db6d6bb420427a2d1aea2e4ca
|
|
BLAKE2b-256 checksum How to use checksums |
715aa39d23854ee6be6cdc8c52f07c2d271e4f9aafc3186822db9db9caa5cb13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/32.3.1 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.3
|
Security for faq-migrations 1.0.25
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.