Migranite
Tool for manage migrations in your project.
Install
pip install migranite
If you want to use MongoDB as database for migrations:
pip install 'migranite[mongo]'
How to start
To initialize the migranite in your project run:
migranite init --migrations migrations_dir --templates templates_dir
This command creates the config file (.migranite) and two directories (migrations_dir and templates_dir).
Create the first migration:
migranite create my-first-migration
This is create the file migrations_dir/001-my-first-migration.py with an empty migration. You need to write a module docstring and implement function run() with your migration logic.
Show the available migrations with statuses:
migranite list
Run all migrations that haven’t been started earlier:
migranite run
Run only specified migrations:
migranite run my-first-migration
Run the migrations that were started earlier:
migranite run --force my-first-migration
Config file
A config file is a simple ini-file with three sections.
[migrations]
Migrations settings.
- path:
Path to directory with migrations.
- digits:
Number of digits in migration number. Default 3.
[templates]
Templates settings.
- path:
Path to directory with templates.
- default:
Default template file name.
[database]
Database settings. Currently only JSON file and MongoDB is supported.
- backend:
Type of database backend (json or mongo).
Other settings are backend-specified.
json
- path:
path to json file.
mongo
- host:
Hostname or ip address. Default localhost.
- port:
Default 27017.
- name:
Name of database. Required.
- collection:
Name of collection. Default migrations.
Metadata
Release files for migranite 0.4.0
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 |
|---|---|---|---|---|
| migranite-0.4.0.tar.bz2 | 7.0 kB | Without provenance | Details for migranite-0.4.0.tar.bz2 |
Release files / migranite-0.4.0.tar.bz2
| Download URL | migranite-0.4.0.tar.bz2 |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abf91dc6dc786068e72f645c3baf7c7172ec157330e3a91e2cf9bff63e786b14
|
|
BLAKE2b-256 checksum How to use checksums |
945fc1e411ea8f0f4549d9b0a1498e4de55f9dac8c1423f010b3f3c4de25e1eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for migranite 0.4.0
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.