Skip to main content

No project description provided

Project description

database_schema_ensurer

Ensures that the database schema is at a certain version.

Usage

Put your migrations in a directory. Each migration SQL file name must obey these rules:

  • Start with {version}_ (e.g. 1_init.sql.up)
  • Have two versions: .up.sql for upgrading (adding the necessary things) and .down.sql for downgrading (undoing the upgrade) (must have the specified extensions)
from database_schema_ensurer import migrate, Database

class MyDatabase(Database):
    ...
    # Implement all the methods or use a library:
    # * Postgres: postgres_schema_ensurer

migrate(MyDatabase(...))
# You can also specify `target_version=` if you want a specific version,
# And you may also specify `migrations_directory` to change the directory the migrations are found at

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

database_schema_ensurer-0.2.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

database_schema_ensurer-0.2.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file database_schema_ensurer-0.2.0.tar.gz.

File metadata

  • Download URL: database_schema_ensurer-0.2.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-35-generic

File hashes

Hashes for database_schema_ensurer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2f0afd486178072d388939a472d66b90af568117132d74d0db9fa391ac761c1d
MD5 df424f41858b1a3a30bcdcef9f0357ca
BLAKE2b-256 717881173dcb262c8af28b146fc80136e795272f04458bb4ae230c0bdf3bdbaf

See more details on using hashes here.

File details

Details for the file database_schema_ensurer-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for database_schema_ensurer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 830d1803ab91f285d576e461c827d8c6653e162216b1edb68e528dc7e73b2887
MD5 30bb8bdc3591655fef749ff948011cc5
BLAKE2b-256 37d719a4e623b8c858d81b59c68a02b78accf4f3ba1725c975d23ffc0e41a891

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