Skip to main content

Migranite -- manage migtations tool

Project description

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.

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

migranite-0.3.0.tar.bz2 (6.7 kB view details)

Uploaded Source

File details

Details for the file migranite-0.3.0.tar.bz2.

File metadata

  • Download URL: migranite-0.3.0.tar.bz2
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for migranite-0.3.0.tar.bz2
Algorithm Hash digest
SHA256 668e38d9d6f52ffe982291b9fe3bb2a99ef4fb6aa92ea254e2143bdab02cfde5
MD5 0507e72f0f662c543865822b81d0ff51
BLAKE2b-256 e70f73e35752de8383d286cc253edfa725cacdef2bb28e4d0ab9b0c00f68f95c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page