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(...),
    target_version=OPTIONAL_SPECIFIC_VERSION, # Default: greatest version from the directory
    migrations_directory=OPTIONAL_SPECIFIC_DIRECTORY, # 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

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

Uploaded Source

Built Distribution

database_schema_ensurer-1.0.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: database_schema_ensurer-1.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4e8965f18d0940536053549f252ba87cc90bd671b6e622c3f63372590f51e194
MD5 60e8899c6fdb1b401fb0e920f989dbda
BLAKE2b-256 fc147ccfe3f7751af5e22d67d906ebf9d9397545f7630cac7ee935e7d6247331

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for database_schema_ensurer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb8e0ccec624c3745e4d97ca00be5ea3079c90fb730b29539e5482ec97ced4d
MD5 5c5e077304df8db03bb4daa4f4acdd3a
BLAKE2b-256 8ded3334df44cebee7b52fb2c73cddc144f26432443fb8553434d308f2e304b1

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