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, the version in main should be bumped to the next release.

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-0.1.13.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file tortoise-data-migration-0.1.13.tar.gz.

File metadata

  • Download URL: tortoise-data-migration-0.1.13.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for tortoise-data-migration-0.1.13.tar.gz
Algorithm Hash digest
SHA256 7d9ece56d9dd501826e39cae83a9c930f615314685d80ff396b23adba195c0f4
MD5 69c392d38e3b76dfcc6b561913523f95
BLAKE2b-256 58e74a1b60ae583641b42dac5e1a72917cb6ff49da06ab7dd5f054e0517641c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tortoise_data_migration-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for tortoise_data_migration-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 b822dc544acb57d934ad59e631e849ecf05382b455a63424bc5c584b23e04344
MD5 9d608dcbb7160ec89bb5689bc0c9f46e
BLAKE2b-256 7eec9f9e55deef702e0adbc94ff9c2724fce3f048318cc8ebbba63d223ad9b1d

See more details on using hashes here.

Supported by

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