Skip to main content

Tortoise migrations for data, not structure

Project description

tortoise-data-migration

tests codecov black poetry-managed PyPI - Python Version PyPI - Wheel PyPI

tortoise-data-migration is a very simple project meant to perform migrations of data, similar to regular structural migrations.

The main use case is when your system has some "default data" that needs to exist for the system to work. Some examples:

  • The default username/password of a system
  • The default configuration values (if you store the config in the DB)

These values could be set in the system as part of the installation process, but then when writing tests that use those, you would have to somehow get those values to the DB. So you create a test fixture, and very probably you will be introducing duplication (the bringup/installation process has these values, and the fixture too).

tortoise-data-migrations are meant to be executed by the software (either during test execution of production) after the database structure is up-to-date (in production software after running aerich migrations for example or during tests after the DB setup is done), but before the actual software starts executing. That's why tortoise-data-migration is a library and not a command line tool.

Installation

Pip

pip install tortoise-data-migration

Pipenv

pipenv install tortoise-data-migration

Poetry

poetry add tortoise-data-migration

PDM

pdm add tortoise-data-migration

Notes for maintainers

Release

To create a new release, create a github release and a github action will take care of building and publishing. After that, there will be a PR automatically created to bump the version in main.

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

tortoise_data_migration-1.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

tortoise_data_migration-1.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file tortoise_data_migration-1.0.1.tar.gz.

File metadata

  • Download URL: tortoise_data_migration-1.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for tortoise_data_migration-1.0.1.tar.gz
Algorithm Hash digest
SHA256 962f2ce4df0a2daa1f4f7e079dc3b4987cc61532f6e3866a6a995b0d8ec42413
MD5 5fb33e06a69528f2573f3edb13bc85ba
BLAKE2b-256 c6de04be584865a98adceacba795da008f14f6519850885722485ea82bead3cb

See more details on using hashes here.

File details

Details for the file tortoise_data_migration-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tortoise_data_migration-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c2be2ef2c2dbdfe9cedbc1a6652bac8511b9c07da3fffd67939c1e174001483b
MD5 474fd86cfe59b5329f2b2c3d912993f9
BLAKE2b-256 74fdb77f38414de1b000bdf1ffa4f4ad634d9c843ca99b7f64dfde77804cebbd

See more details on using hashes here.

Supported by

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